Skip to content
This repository has been archived by the owner on Aug 21, 2022. It is now read-only.

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
Octane committed Nov 21, 2014
2 parents 0d07722 + eac8789 commit a045f4a
Show file tree
Hide file tree
Showing 22 changed files with 90 additions and 86 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ global | `FormData()`<sup>[12](#FormData)</sup>, `Set()`, `Map()`, `WeakSet()`,
`window` | `.setImmediate()`, `.clearImmediate()`, `.requestAnimationFrame()`, `.cancelAnimationFrame()`, `.getComputedStyle()`
`Object` generics | `.create()`<sup>[1](#Object.create)</sup>, `.assign()`<sup>[2](#Object.assign)</sup>, `.is()`, `.keys()`<sup>[3](#Object.keys)</sup>, `.setPrototypeOf()`<sup>[16](#Object.setPrototypeOf)</sup>
`Array` generics<sup>[4](#Array_generics)</sup> | `.isArray()`, `.from()`, `.of()`, `.concat()`, `.every()`, `.fill()`, `.filter()`, `.find()`, `.findIndex()`, `.forEach()`, `.indexOf()`, `.join()`, `.lastIndexOf()`, `.map()`, `.pop()`, `.push()`, `.reduce()`, `.reduceRight()`, `.reverse()`, `.shift()`, `.slice()`<sup>[5](#Array.slice)</sup>, `.some()`, `.sort()`, `.splice()`<sup>[6](#Array.splice)</sup>, `.unshift()`
`Array.prototype` | `.every()`, `.fill()`, `.filter()`, `.find()`, `.findIndex()`, `.forEach()`, `.indexOf()`, `.lastIndexOf()`, `.map()`, `.reduce()`, `.reduceRight()`, `.some()`, `.contains()`
`String` generics | `.charAt()`, `.charCodeAt()`, `.concat()`, `.contains()`, `.endsWith()`, `.indexOf()`, `.lastIndexOf()`, `.match()`, `.repeat()`, `.replace()`, `.search()`, `.slice()`, `.split()`, `.startsWith()`, `.substr()`, `.substring()`, `.toLowerCase()`, `.toUpperCase()`, `.trim()`
`String.prototype` | `.contains()`, `.endsWith()`, `.repeat()`, `.startsWith()`, `.trim()`
`Array.prototype` | `.every()`, `.fill()`, `.filter()`, `.find()`, `.findIndex()`, `.forEach()`, `.indexOf()`, `.lastIndexOf()`, `.map()`, `.reduce()`, `.reduceRight()`, `.some()`, `.includes()`
`String` generics | `.charAt()`, `.charCodeAt()`, `.concat()`, `.includes()`, `.endsWith()`, `.indexOf()`, `.lastIndexOf()`, `.match()`, `.repeat()`, `.replace()`, `.search()`, `.slice()`, `.split()`, `.startsWith()`, `.substr()`, `.substring()`, `.toLowerCase()`, `.toUpperCase()`, `.trim()`
`String.prototype` | `.includes()`, `.endsWith()`, `.repeat()`, `.startsWith()`, `.trim()`
`Number` generics | `.isInteger()`, `.isFinite()`, `.isNaN()`, `.parseInt()`, `.parseFloat()`
`Math` generics | `.trunc()`, `.sign()`
`Function.prototype` | `.bind()`
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jsCore",
"main": "jscore.js",
"version": "0.7.0",
"version": "0.8.0",
"description": "Complex JavaScript polyfill and set of methods",
"keywords": [
"browser",
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#jsCore changelog

##v0.8.0

- `.contains()` renamed to `.includes()` ([more info](https://twitter.com/mathias/status/535350698918297600))

##v0.7.0

- fix: `Array.contains()` for non-Array objects
Expand Down
16 changes: 8 additions & 8 deletions dev/jscore-ie10.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jsCore JavaScript library v0.7.0 IE10+
/* jsCore JavaScript library v0.8.0 IE10+
* © 2014 Dmitry Korobkin
* Released under the MIT license
* github.com/Octane/jsCore
Expand Down Expand Up @@ -133,8 +133,8 @@ if (!Array.prototype.fill) {
};
}

if (!Array.prototype.contains) {
Array.prototype.contains = function (anything, position) {
if (!Array.prototype.includes) {
Array.prototype.includes = function (anything, position) {
var length = this.length,
i;
if (!length) {
Expand Down Expand Up @@ -182,8 +182,8 @@ if (!String.prototype.endsWith) {
};
}

if (!String.prototype.contains) {
String.prototype.contains = function (string, position) {
if (!String.prototype.includes) {
String.prototype.includes = function (string, position) {
return -1 != this.indexOf(string, position || 0);
};
}
Expand Down Expand Up @@ -283,11 +283,11 @@ new function () {
'findIndex', 'forEach', 'indexOf', 'join',
'lastIndexOf', 'map', 'pop', 'push', 'reduce',
'reduceRight', 'reverse', 'shift', 'slice',
'some', 'sort', 'splice', 'unshift', 'contains'
'some', 'sort', 'splice', 'unshift', 'includes'
]));

implement(String, createGenerics(String.prototype, [
'charAt', 'charCodeAt', 'concat', 'contains','endsWith',
'charAt', 'charCodeAt', 'concat', 'includes','endsWith',
'indexOf', 'lastIndexOf', 'match', 'repeat', 'replace',
'search', 'slice', 'split', 'startsWith', 'substr',
'substring', 'toLowerCase', 'toUpperCase', 'trim'
Expand Down Expand Up @@ -1059,7 +1059,7 @@ document.documentElement.matches || new function () {
proto.matches = new function () {
var ELEMENT_NODE = 1;
function isContains(root, element, selector) {
return Array.contains(root.querySelectorAll(selector), element);
return Array.includes(root.querySelectorAll(selector), element);
}
return function (selector) {
var contains,
Expand Down
20 changes: 10 additions & 10 deletions dev/jscore-ie9.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jsCore JavaScript library v0.7.0 IE9+
/* jsCore JavaScript library v0.8.0 IE9+
* © 2014 Dmitry Korobkin
* Released under the MIT license
* github.com/Octane/jsCore
Expand Down Expand Up @@ -133,8 +133,8 @@ if (!Array.prototype.fill) {
};
}

if (!Array.prototype.contains) {
Array.prototype.contains = function (anything, position) {
if (!Array.prototype.includes) {
Array.prototype.includes = function (anything, position) {
var length = this.length,
i;
if (!length) {
Expand Down Expand Up @@ -182,8 +182,8 @@ if (!String.prototype.endsWith) {
};
}

if (!String.prototype.contains) {
String.prototype.contains = function (string, position) {
if (!String.prototype.includes) {
String.prototype.includes = function (string, position) {
return -1 != this.indexOf(string, position || 0);
};
}
Expand Down Expand Up @@ -283,11 +283,11 @@ new function () {
'findIndex', 'forEach', 'indexOf', 'join',
'lastIndexOf', 'map', 'pop', 'push', 'reduce',
'reduceRight', 'reverse', 'shift', 'slice',
'some', 'sort', 'splice', 'unshift', 'contains'
'some', 'sort', 'splice', 'unshift', 'includes'
]));

implement(String, createGenerics(String.prototype, [
'charAt', 'charCodeAt', 'concat', 'contains','endsWith',
'charAt', 'charCodeAt', 'concat', 'includes','endsWith',
'indexOf', 'lastIndexOf', 'match', 'repeat', 'replace',
'search', 'slice', 'split', 'startsWith', 'substr',
'substring', 'toLowerCase', 'toUpperCase', 'trim'
Expand Down Expand Up @@ -1059,7 +1059,7 @@ document.documentElement.matches || new function () {
proto.matches = new function () {
var ELEMENT_NODE = 1;
function isContains(root, element, selector) {
return Array.contains(root.querySelectorAll(selector), element);
return Array.includes(root.querySelectorAll(selector), element);
}
return function (selector) {
var contains,
Expand Down Expand Up @@ -1129,7 +1129,7 @@ Object.defineProperty(HTMLElement.prototype, 'classList', {
this._update();
length = this.length;
Array.forEach(arguments, function (token) {
if (!Array.contains(this, token)) {
if (!Array.includes(this, token)) {
Array.push(this, token);
}
}, this);
Expand Down Expand Up @@ -1165,7 +1165,7 @@ Object.defineProperty(HTMLElement.prototype, 'classList', {

contains: function (token) {
this._update();
return Array.contains(this, token);
return Array.includes(this, token);
},

toString: function () {
Expand Down
16 changes: 8 additions & 8 deletions dev/jscore-polyfill-ie10.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jsCore JavaScript polyfill v0.7.0 IE10+
/* jsCore JavaScript polyfill v0.8.0 IE10+
* © 2014 Dmitry Korobkin
* Released under the MIT license
* github.com/Octane/jsCore
Expand Down Expand Up @@ -133,8 +133,8 @@ if (!Array.prototype.fill) {
};
}

if (!Array.prototype.contains) {
Array.prototype.contains = function (anything, position) {
if (!Array.prototype.includes) {
Array.prototype.includes = function (anything, position) {
var length = this.length,
i;
if (!length) {
Expand Down Expand Up @@ -182,8 +182,8 @@ if (!String.prototype.endsWith) {
};
}

if (!String.prototype.contains) {
String.prototype.contains = function (string, position) {
if (!String.prototype.includes) {
String.prototype.includes = function (string, position) {
return -1 != this.indexOf(string, position || 0);
};
}
Expand Down Expand Up @@ -283,11 +283,11 @@ new function () {
'findIndex', 'forEach', 'indexOf', 'join',
'lastIndexOf', 'map', 'pop', 'push', 'reduce',
'reduceRight', 'reverse', 'shift', 'slice',
'some', 'sort', 'splice', 'unshift', 'contains'
'some', 'sort', 'splice', 'unshift', 'includes'
]));

implement(String, createGenerics(String.prototype, [
'charAt', 'charCodeAt', 'concat', 'contains','endsWith',
'charAt', 'charCodeAt', 'concat', 'includes','endsWith',
'indexOf', 'lastIndexOf', 'match', 'repeat', 'replace',
'search', 'slice', 'split', 'startsWith', 'substr',
'substring', 'toLowerCase', 'toUpperCase', 'trim'
Expand Down Expand Up @@ -1059,7 +1059,7 @@ document.documentElement.matches || new function () {
proto.matches = new function () {
var ELEMENT_NODE = 1;
function isContains(root, element, selector) {
return Array.contains(root.querySelectorAll(selector), element);
return Array.includes(root.querySelectorAll(selector), element);
}
return function (selector) {
var contains,
Expand Down
20 changes: 10 additions & 10 deletions dev/jscore-polyfill-ie9.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jsCore JavaScript polyfill v0.7.0 IE9+
/* jsCore JavaScript polyfill v0.8.0 IE9+
* © 2014 Dmitry Korobkin
* Released under the MIT license
* github.com/Octane/jsCore
Expand Down Expand Up @@ -133,8 +133,8 @@ if (!Array.prototype.fill) {
};
}

if (!Array.prototype.contains) {
Array.prototype.contains = function (anything, position) {
if (!Array.prototype.includes) {
Array.prototype.includes = function (anything, position) {
var length = this.length,
i;
if (!length) {
Expand Down Expand Up @@ -182,8 +182,8 @@ if (!String.prototype.endsWith) {
};
}

if (!String.prototype.contains) {
String.prototype.contains = function (string, position) {
if (!String.prototype.includes) {
String.prototype.includes = function (string, position) {
return -1 != this.indexOf(string, position || 0);
};
}
Expand Down Expand Up @@ -283,11 +283,11 @@ new function () {
'findIndex', 'forEach', 'indexOf', 'join',
'lastIndexOf', 'map', 'pop', 'push', 'reduce',
'reduceRight', 'reverse', 'shift', 'slice',
'some', 'sort', 'splice', 'unshift', 'contains'
'some', 'sort', 'splice', 'unshift', 'includes'
]));

implement(String, createGenerics(String.prototype, [
'charAt', 'charCodeAt', 'concat', 'contains','endsWith',
'charAt', 'charCodeAt', 'concat', 'includes','endsWith',
'indexOf', 'lastIndexOf', 'match', 'repeat', 'replace',
'search', 'slice', 'split', 'startsWith', 'substr',
'substring', 'toLowerCase', 'toUpperCase', 'trim'
Expand Down Expand Up @@ -1059,7 +1059,7 @@ document.documentElement.matches || new function () {
proto.matches = new function () {
var ELEMENT_NODE = 1;
function isContains(root, element, selector) {
return Array.contains(root.querySelectorAll(selector), element);
return Array.includes(root.querySelectorAll(selector), element);
}
return function (selector) {
var contains,
Expand Down Expand Up @@ -1129,7 +1129,7 @@ Object.defineProperty(HTMLElement.prototype, 'classList', {
this._update();
length = this.length;
Array.forEach(arguments, function (token) {
if (!Array.contains(this, token)) {
if (!Array.includes(this, token)) {
Array.push(this, token);
}
}, this);
Expand Down Expand Up @@ -1165,7 +1165,7 @@ Object.defineProperty(HTMLElement.prototype, 'classList', {

contains: function (token) {
this._update();
return Array.contains(this, token);
return Array.includes(this, token);
},

toString: function () {
Expand Down
22 changes: 11 additions & 11 deletions dev/jscore-polyfill.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jsCore JavaScript polyfill v0.7.0 IE8+
/* jsCore JavaScript polyfill v0.8.0 IE8+
* © 2014 Dmitry Korobkin
* Released under the MIT license
* github.com/Octane/jsCore
Expand Down Expand Up @@ -529,8 +529,8 @@ if (!Array.prototype.fill) {
};
}

if (!Array.prototype.contains) {
Array.prototype.contains = function (anything, position) {
if (!Array.prototype.includes) {
Array.prototype.includes = function (anything, position) {
var length = this.length,
i;
if (!length) {
Expand Down Expand Up @@ -578,8 +578,8 @@ if (!String.prototype.endsWith) {
};
}

if (!String.prototype.contains) {
String.prototype.contains = function (string, position) {
if (!String.prototype.includes) {
String.prototype.includes = function (string, position) {
return -1 != this.indexOf(string, position || 0);
};
}
Expand Down Expand Up @@ -679,11 +679,11 @@ new function () {
'findIndex', 'forEach', 'indexOf', 'join',
'lastIndexOf', 'map', 'pop', 'push', 'reduce',
'reduceRight', 'reverse', 'shift', 'slice',
'some', 'sort', 'splice', 'unshift', 'contains'
'some', 'sort', 'splice', 'unshift', 'includes'
]));

implement(String, createGenerics(String.prototype, [
'charAt', 'charCodeAt', 'concat', 'contains','endsWith',
'charAt', 'charCodeAt', 'concat', 'includes','endsWith',
'indexOf', 'lastIndexOf', 'match', 'repeat', 'replace',
'search', 'slice', 'split', 'startsWith', 'substr',
'substring', 'toLowerCase', 'toUpperCase', 'trim'
Expand Down Expand Up @@ -1504,7 +1504,7 @@ document.documentElement.matches || new function () {
proto.matches = new function () {
var ELEMENT_NODE = 1;
function isContains(root, element, selector) {
return Array.contains(root.querySelectorAll(selector), element);
return Array.includes(root.querySelectorAll(selector), element);
}
return function (selector) {
var contains,
Expand Down Expand Up @@ -1574,7 +1574,7 @@ Object.defineProperty(HTMLElement.prototype, 'classList', {
this._update();
length = this.length;
Array.forEach(arguments, function (token) {
if (!Array.contains(this, token)) {
if (!Array.includes(this, token)) {
Array.push(this, token);
}
}, this);
Expand Down Expand Up @@ -1610,7 +1610,7 @@ Object.defineProperty(HTMLElement.prototype, 'classList', {

contains: function (token) {
this._update();
return Array.contains(this, token);
return Array.includes(this, token);
},

toString: function () {
Expand Down Expand Up @@ -2293,7 +2293,7 @@ window instanceof Object || new function () {
}

function hasAlphaFilter(filter) {
return filter.toLowerCase().contains('alpha');
return filter.toLowerCase().includes('alpha');
}

Object.defineProperty(proto, 'cssFloat', {
Expand Down
Loading

0 comments on commit a045f4a

Please sign in to comment.