core-js 2.1.5 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +93 -68
- package/bower.json +1 -1
- package/build/config.js +3 -6
- package/client/core.js +1382 -1102
- package/client/core.min.js +4 -4
- package/client/core.min.js.map +1 -1
- package/client/library.js +1314 -1049
- package/client/library.min.js +4 -4
- package/client/library.min.js.map +1 -1
- package/client/shim.js +1326 -1046
- package/client/shim.min.js +4 -4
- package/client/shim.min.js.map +1 -1
- package/es6/date.js +1 -0
- package/es6/index.js +3 -2
- package/es7/asap.js +2 -0
- package/es7/index.js +8 -0
- package/es7/object.js +4 -0
- package/es7/string.js +1 -0
- package/es7/symbol.js +3 -0
- package/fn/asap.js +2 -0
- package/fn/date/index.js +1 -0
- package/fn/date/to-primitive.js +5 -0
- package/fn/object/define-getter.js +2 -0
- package/fn/object/define-setter.js +2 -0
- package/fn/object/index.js +4 -0
- package/fn/object/lookup-getter.js +2 -0
- package/fn/object/lookup-setter.js +2 -0
- package/fn/string/index.js +1 -0
- package/fn/string/match-all.js +2 -0
- package/fn/string/virtual/index.js +1 -0
- package/fn/string/virtual/match-all.js +2 -0
- package/fn/symbol/async-iterator.js +2 -0
- package/fn/symbol/has-instance.js +2 -1
- package/fn/symbol/index.js +2 -0
- package/fn/symbol/is-concat-spreadable.js +1 -1
- package/fn/symbol/iterator.js +1 -1
- package/fn/symbol/match.js +1 -1
- package/fn/symbol/observable.js +2 -0
- package/fn/symbol/replace.js +1 -1
- package/fn/symbol/search.js +1 -1
- package/fn/symbol/species.js +1 -1
- package/fn/symbol/split.js +1 -1
- package/fn/symbol/to-primitive.js +1 -1
- package/fn/symbol/to-string-tag.js +1 -1
- package/fn/symbol/unscopables.js +1 -1
- package/library/es6/date.js +1 -0
- package/library/es6/index.js +3 -2
- package/library/es7/asap.js +2 -0
- package/library/es7/index.js +8 -0
- package/library/es7/object.js +4 -0
- package/library/es7/string.js +1 -0
- package/library/es7/symbol.js +3 -0
- package/library/fn/asap.js +2 -0
- package/library/fn/date/index.js +1 -0
- package/library/fn/date/to-primitive.js +5 -0
- package/library/fn/object/define-getter.js +2 -0
- package/library/fn/object/define-setter.js +2 -0
- package/library/fn/object/index.js +4 -0
- package/library/fn/object/lookup-getter.js +2 -0
- package/library/fn/object/lookup-setter.js +2 -0
- package/library/fn/string/index.js +1 -0
- package/library/fn/string/match-all.js +2 -0
- package/library/fn/string/virtual/index.js +1 -0
- package/library/fn/string/virtual/match-all.js +2 -0
- package/library/fn/symbol/async-iterator.js +2 -0
- package/library/fn/symbol/has-instance.js +2 -1
- package/library/fn/symbol/index.js +2 -0
- package/library/fn/symbol/is-concat-spreadable.js +1 -1
- package/library/fn/symbol/iterator.js +1 -1
- package/library/fn/symbol/match.js +1 -1
- package/library/fn/symbol/observable.js +2 -0
- package/library/fn/symbol/replace.js +1 -1
- package/library/fn/symbol/search.js +1 -1
- package/library/fn/symbol/species.js +1 -1
- package/library/fn/symbol/split.js +1 -1
- package/library/fn/symbol/to-primitive.js +1 -1
- package/library/fn/symbol/to-string-tag.js +1 -1
- package/library/fn/symbol/unscopables.js +1 -1
- package/library/modules/_array-includes.js +1 -1
- package/library/modules/_array-species-constructor.js +16 -0
- package/library/modules/_array-species-create.js +3 -13
- package/library/modules/_core.js +1 -1
- package/library/modules/_create-property.js +8 -0
- package/library/modules/_date-to-primitive.js +9 -0
- package/library/modules/_iter-detect.js +1 -1
- package/library/modules/_math-expm1.js +8 -2
- package/library/modules/_microtask.js +58 -48
- package/library/modules/{_object-ipam.js → _object-forced-pam.js} +2 -2
- package/library/modules/_object-gopn-ext.js +2 -2
- package/library/modules/_string-pad.js +1 -2
- package/library/modules/_typed-array.js +11 -5
- package/library/modules/_wks-define.js +9 -0
- package/library/modules/_wks-ext.js +1 -0
- package/library/modules/_wks.js +5 -2
- package/library/modules/es6.array.filter.js +9 -9
- package/library/modules/es6.array.from.js +11 -9
- package/library/modules/es6.array.index-of.js +9 -4
- package/library/modules/es6.array.last-index-of.js +10 -6
- package/library/modules/es6.array.of.js +3 -2
- package/library/modules/es6.math.acosh.js +6 -2
- package/library/modules/es6.math.asinh.js +4 -2
- package/library/modules/es6.math.atanh.js +4 -2
- package/library/modules/es6.math.expm1.js +3 -2
- package/library/modules/es6.promise.js +1 -1
- package/library/modules/es6.symbol.js +58 -63
- package/library/modules/es7.array.includes.js +1 -1
- package/library/modules/es7.asap.js +12 -0
- package/library/modules/es7.object.define-getter.js +1 -1
- package/library/modules/es7.object.define-setter.js +1 -1
- package/library/modules/es7.object.entries.js +1 -1
- package/library/modules/es7.object.get-own-property-descriptors.js +8 -12
- package/library/modules/es7.object.lookup-getter.js +1 -1
- package/library/modules/es7.object.lookup-setter.js +1 -1
- package/library/modules/es7.object.values.js +1 -1
- package/library/modules/es7.string.match-all.js +7 -8
- package/library/modules/es7.string.pad-end.js +1 -0
- package/library/modules/es7.string.pad-start.js +1 -0
- package/library/modules/es7.symbol.async-iterator.js +1 -0
- package/library/modules/es7.symbol.observable.js +1 -0
- package/library/shim.js +11 -2
- package/library/stage/0.js +1 -0
- package/library/stage/1.js +3 -2
- package/library/stage/2.js +3 -1
- package/library/stage/3.js +1 -3
- package/library/stage/4.js +7 -1
- package/modules/_array-includes.js +1 -1
- package/modules/_array-species-constructor.js +16 -0
- package/modules/_array-species-create.js +3 -13
- package/modules/_core.js +1 -1
- package/modules/_create-property.js +8 -0
- package/modules/_date-to-primitive.js +9 -0
- package/modules/_iter-detect.js +1 -1
- package/modules/_math-expm1.js +8 -2
- package/modules/_microtask.js +58 -48
- package/modules/{_object-ipam.js → _object-forced-pam.js} +2 -2
- package/modules/_object-gopn-ext.js +2 -2
- package/modules/_string-pad.js +1 -2
- package/modules/_typed-array.js +11 -5
- package/modules/_wks-define.js +9 -0
- package/modules/_wks-ext.js +1 -0
- package/modules/_wks.js +5 -2
- package/modules/es6.array.filter.js +9 -9
- package/modules/es6.array.from.js +11 -9
- package/modules/es6.array.index-of.js +9 -4
- package/modules/es6.array.last-index-of.js +10 -6
- package/modules/es6.array.of.js +3 -2
- package/modules/es6.date.to-primitive.js +3 -11
- package/modules/es6.function.name.js +13 -4
- package/modules/es6.math.acosh.js +6 -2
- package/modules/es6.math.asinh.js +4 -2
- package/modules/es6.math.atanh.js +4 -2
- package/modules/es6.math.expm1.js +3 -2
- package/modules/es6.promise.js +1 -1
- package/modules/es6.symbol.js +58 -63
- package/modules/es7.array.includes.js +1 -1
- package/modules/es7.asap.js +12 -0
- package/modules/es7.object.define-getter.js +1 -1
- package/modules/es7.object.define-setter.js +1 -1
- package/modules/es7.object.entries.js +1 -1
- package/modules/es7.object.get-own-property-descriptors.js +8 -12
- package/modules/es7.object.lookup-getter.js +1 -1
- package/modules/es7.object.lookup-setter.js +1 -1
- package/modules/es7.object.values.js +1 -1
- package/modules/es7.string.match-all.js +7 -8
- package/modules/es7.string.pad-end.js +1 -0
- package/modules/es7.string.pad-start.js +1 -0
- package/modules/es7.symbol.async-iterator.js +1 -0
- package/modules/es7.symbol.observable.js +1 -0
- package/package.json +7 -7
- package/shim.js +11 -2
- package/stage/0.js +1 -0
- package/stage/1.js +3 -2
- package/stage/2.js +3 -1
- package/stage/3.js +1 -3
- package/stage/4.js +7 -1
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ core.Promise.resolve(32).then(x => console.log(x)); // => 32
|
|
|
22
22
|
core.setImmediate(x => console.log(x), 42); // => 42
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
### Index
|
|
25
26
|
- [Usage](#usage)
|
|
26
27
|
- [Basic](#basic)
|
|
27
28
|
- [CommonJS](#commonjs)
|
|
@@ -76,9 +77,9 @@ require('core-js/shim');
|
|
|
76
77
|
```
|
|
77
78
|
If you need complete build for browser, use builds from `core-js/client` path:
|
|
78
79
|
|
|
79
|
-
* [default](https://raw.githack.com/zloirock/core-js/v2.
|
|
80
|
-
* [as a library](https://raw.githack.com/zloirock/core-js/v2.
|
|
81
|
-
* [shim only](https://raw.githack.com/zloirock/core-js/v2.
|
|
80
|
+
* [default](https://raw.githack.com/zloirock/core-js/v2.3.0/client/core.min.js): Includes all features, standard and non-standard.
|
|
81
|
+
* [as a library](https://raw.githack.com/zloirock/core-js/v2.3.0/client/library.min.js): Like "default", but does not pollute the global namespace (see [2nd example at the top](#core-js)).
|
|
82
|
+
* [shim only](https://raw.githack.com/zloirock/core-js/v2.3.0/client/shim.min.js): Only includes the standard methods.
|
|
82
83
|
|
|
83
84
|
Warning: if you use `core-js` with the extension of native objects, require all needed `core-js` modules at the beginning of entry point of your application, otherwise, conflicts may occur.
|
|
84
85
|
|
|
@@ -228,11 +229,11 @@ core-js(/library)/es5
|
|
|
228
229
|
core-js(/library)/es6
|
|
229
230
|
```
|
|
230
231
|
#### ECMAScript 6: Object
|
|
231
|
-
Modules [`es6.object.assign`](https://github.com/zloirock/core-js/blob/v2.
|
|
232
|
+
Modules [`es6.object.assign`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.assign.js), [`es6.object.is`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.is.js), [`es6.object.set-prototype-of`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.set-prototype-of.js) and [`es6.object.to-string`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.to-string.js).
|
|
232
233
|
|
|
233
|
-
In ES6 most `Object` static methods should work with primitives. Modules [`es6.object.freeze`](https://github.com/zloirock/core-js/blob/v2.
|
|
234
|
+
In ES6 most `Object` static methods should work with primitives. Modules [`es6.object.freeze`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.freeze.js), [`es6.object.seal`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.seal.js), [`es6.object.prevent-extensions`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.prevent-extensions.js), [`es6.object.is-frozen`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.is-frozen.js), [`es6.object.is-sealed`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.is-sealed.js), [`es6.object.is-extensible`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.is-extensible.js), [`es6.object.get-own-property-descriptor`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.get-own-property-descriptor.js), [`es6.object.get-prototype-of`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.get-prototype-of.js), [`es6.object.keys`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.keys.js) and [`es6.object.get-own-property-names`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.get-own-property-names.js).
|
|
234
235
|
|
|
235
|
-
Just ES5 features: [`es6.object.create`](https://github.com/zloirock/core-js/blob/v2.
|
|
236
|
+
Just ES5 features: [`es6.object.create`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.create.js), [`es6.object.define-property`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.define-property.js) and [`es6.object.define-properties`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.object.es6.object.define-properties.js).
|
|
236
237
|
```js
|
|
237
238
|
Object
|
|
238
239
|
.assign(target, ...src) -> target
|
|
@@ -300,7 +301,7 @@ Object.keys('qwe'); // => ['0', '1', '2']
|
|
|
300
301
|
Object.getPrototypeOf('qwe') === String.prototype; // => true
|
|
301
302
|
```
|
|
302
303
|
#### ECMAScript 6: Function
|
|
303
|
-
Modules [`es6.function.name`](https://github.com/zloirock/core-js/blob/v2.
|
|
304
|
+
Modules [`es6.function.name`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.function.name.js), [`es6.function.has-instance`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.function.has-instance.js). Just ES5: [`es6.function.bind`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.function.bind.js).
|
|
304
305
|
```js
|
|
305
306
|
Function
|
|
306
307
|
#bind(object, ...args) -> boundFn(...args)
|
|
@@ -322,7 +323,7 @@ core-js/fn/function/virtual/bind
|
|
|
322
323
|
console.log.bind(console, 42)(43); // => 42 43
|
|
323
324
|
```
|
|
324
325
|
#### ECMAScript 6: Array
|
|
325
|
-
Modules [`es6.array.from`](https://github.com/zloirock/core-js/blob/v2.
|
|
326
|
+
Modules [`es6.array.from`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.from.js), [`es6.array.of`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.of.js), [`es6.array.copy-within`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.copy-within.js), [`es6.array.fill`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.fill.js), [`es6.array.find`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.find.js), [`es6.array.find-index`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.find-index.js), [`es6.array.iterator`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.iterator.js). ES5 features with fixes: [`es6.array.is-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.is-array.js), [`es6.array.slice`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.slice.js), [`es6.array.join`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.join.js), [`es6.array.index-of`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.index-of.js), [`es6.array.last-index-of`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.last-index-of.js), [`es6.array.every`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.every.js), [`es6.array.some`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.some.js), [`es6.array.for-each`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.for-each.js), [`es6.array.map`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.map.js), [`es6.array.filter`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.filter.js), [`es6.array.reduce`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.reduce.js), [`es6.array.reduce-right`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.reduce-right.js), [`es6.array.sort`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.array.sort.js).
|
|
326
327
|
```js
|
|
327
328
|
Array
|
|
328
329
|
.from(iterable | array-like, mapFn(val, index)?, that) -> array
|
|
@@ -434,9 +435,9 @@ Array(5).fill(42); // => [42, 42, 42, 42, 42]
|
|
|
434
435
|
[1, 2, 3, 4, 5].copyWithin(0, 3); // => [4, 5, 3, 4, 5]
|
|
435
436
|
```
|
|
436
437
|
#### ECMAScript 6: String
|
|
437
|
-
Modules [`es6.string.from-code-point`](https://github.com/zloirock/core-js/blob/v2.
|
|
438
|
+
Modules [`es6.string.from-code-point`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.from-code-point.js), [`es6.string.raw`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.raw.js), [`es6.string.iterator`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.iterator.js), [`es6.string.code-point-at`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.code-point-at.js), [`es6.string.ends-with`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.ends-with.js), [`es6.string.includes`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.includes.js), [`es6.string.repeat`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.repeat.js), [`es6.string.starts-with`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.starts-with.js) and [`es6.string.trim`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.trim.js).
|
|
438
439
|
|
|
439
|
-
Annex B HTML methods. Ugly, but it's also the part of the spec. Modules [`es6.string.anchor`](https://github.com/zloirock/core-js/blob/v2.
|
|
440
|
+
Annex B HTML methods. Ugly, but it's also the part of the spec. Modules [`es6.string.anchor`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.anchor.js), [`es6.string.big`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.big.js), [`es6.string.blink`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.blink.js), [`es6.string.bold`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.bold.js), [`es6.string.fixed`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.fixed.js), [`es6.string.fontcolor`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.fontcolor.js), [`es6.string.fontsize`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.fontsize.js), [`es6.string.italics`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.italics.js), [`es6.string.link`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.link.js), [`es6.string.small`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.small.js), [`es6.string.strike`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.strike.js), [`es6.string.sub`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.sub.js) and [`es6.string.sup`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.string.sup.js).
|
|
440
441
|
```js
|
|
441
442
|
String
|
|
442
443
|
.fromCodePoint(...codePoints) -> str
|
|
@@ -535,9 +536,9 @@ String.raw({raw: 'test'}, 0, 1, 2); // => 't0e1s2t'
|
|
|
535
536
|
'baz'.link('http://example.com'); // => '<a href="http://example.com">baz</a>'
|
|
536
537
|
```
|
|
537
538
|
#### ECMAScript 6: RegExp
|
|
538
|
-
Modules [`es6.regexp.constructor`](https://github.com/zloirock/core-js/blob/v2.
|
|
539
|
+
Modules [`es6.regexp.constructor`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.regexp.constructor.js) and [`es6.regexp.flags`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.regexp.flags.js).
|
|
539
540
|
|
|
540
|
-
Support well-known [symbols](#ecmascript-6-symbol) `@@match`, `@@replace`, `@@search` and `@@split`, modules [`es6.regexp.match`](https://github.com/zloirock/core-js/blob/v2.
|
|
541
|
+
Support well-known [symbols](#ecmascript-6-symbol) `@@match`, `@@replace`, `@@search` and `@@split`, modules [`es6.regexp.match`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.regexp.match.js), [`es6.regexp.replace`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.regexp.replace.js), [`es6.regexp.search`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.regexp.search.js) and [`es6.regexp.split`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.regexp.split.js).
|
|
541
542
|
```
|
|
542
543
|
[new] RegExp(pattern, flags?) -> regexp, ES6 fix: can alter flags (IE9+)
|
|
543
544
|
#flags -> str (IE9+)
|
|
@@ -578,12 +579,12 @@ RegExp(/./g, 'm'); // => /./m
|
|
|
578
579
|
RegExp.prototype.toString.call({source: 'foo', flags: 'bar'}); // => '/foo/bar'
|
|
579
580
|
```
|
|
580
581
|
#### ECMAScript 6: Number
|
|
581
|
-
Module [`es6.number.constructor`](https://github.com/zloirock/core-js/blob/v2.
|
|
582
|
+
Module [`es6.number.constructor`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.constructor.js). `Number` constructor support binary and octal literals, [*example*](http://goo.gl/jRd6b3):
|
|
582
583
|
```js
|
|
583
584
|
Number('0b1010101'); // => 85
|
|
584
585
|
Number('0o7654321'); // => 2054353
|
|
585
586
|
```
|
|
586
|
-
Modules [`es6.number.epsilon`](https://github.com/zloirock/core-js/blob/v2.
|
|
587
|
+
Modules [`es6.number.epsilon`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.epsilon.js), [`es6.number.is-finite`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.is-finite.js), [`es6.number.is-integer`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.is-integer.js), [`es6.number.is-nan`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.is-nan.js), [`es6.number.is-safe-integer`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.is-safe-integer.js), [`es6.number.max-safe-integer`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.max-safe-integer.js), [`es6.number.min-safe-integer`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.min-safe-integer.js), [`es6.number.parse-float`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.parse-float.js), [`es6.number.parse-int`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.parse-int.js), [`es6.number.to-fixed`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.to-fixed.js), [`es6.number.to-precision`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.number.to-precision.js), [`es6.parse-int`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.parse-int.js), [`es6.parse-float`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.parse-float.js).
|
|
587
588
|
```js
|
|
588
589
|
[new] Number(var) -> number | number object
|
|
589
590
|
.isFinite(num) -> bool
|
|
@@ -619,7 +620,7 @@ core-js(/library)/fn/parse-float
|
|
|
619
620
|
core-js(/library)/fn/parse-int
|
|
620
621
|
```
|
|
621
622
|
#### ECMAScript 6: Math
|
|
622
|
-
Modules [`es6.math.acosh`](https://github.com/zloirock/core-js/blob/v2.
|
|
623
|
+
Modules [`es6.math.acosh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.acosh.js), [`es6.math.asinh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.asinh.js), [`es6.math.atanh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.atanh.js), [`es6.math.cbrt`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.cbrt.js), [`es6.math.clz32`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.clz32.js), [`es6.math.cosh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.cosh.js), [`es6.math.expm1`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.expm1.js), [`es6.math.fround`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.fround.js), [`es6.math.hypot`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.hypot.js), [`es6.math.imul`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.imul.js), [`es6.math.log10`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.log10.js), [`es6.math.log1p`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.log1p.js), [`es6.math.log2`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.log2.js), [`es6.math.sign`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.sign.js), [`es6.math.sinh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.sinh.js), [`es6.math.tanh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.tanh.js), [`es6.math.trunc`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.math.trunc.js).
|
|
623
624
|
```js
|
|
624
625
|
Math
|
|
625
626
|
.acosh(num) -> num
|
|
@@ -662,13 +663,14 @@ core-js(/library)/fn/math/tanh
|
|
|
662
663
|
core-js(/library)/fn/math/trunc
|
|
663
664
|
```
|
|
664
665
|
#### ECMAScript 6: Date
|
|
665
|
-
Modules [`es6.date.to-string`](https://github.com/zloirock/core-js/blob/v2.
|
|
666
|
+
Modules [`es6.date.to-string`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.date.to-string.js), ES5 features with fixes: [`es6.date.now`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.date.now.js), [`es6.date.to-iso-string`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.date.to-iso-string.js), [`es6.date.to-json`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.date.to-json.js) and [`es6.date.to-primitive`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.date.to-primitive.js).
|
|
666
667
|
```js
|
|
667
668
|
Date
|
|
668
|
-
.now()
|
|
669
|
-
#toISOString()
|
|
670
|
-
#toJSON()
|
|
671
|
-
#toString()
|
|
669
|
+
.now() -> int
|
|
670
|
+
#toISOString() -> string
|
|
671
|
+
#toJSON() -> string
|
|
672
|
+
#toString() -> string
|
|
673
|
+
#@@toPrimitive(hint) -> primitive
|
|
672
674
|
```
|
|
673
675
|
[*CommonJS entry points:*](#commonjs)
|
|
674
676
|
```
|
|
@@ -677,6 +679,7 @@ core-js/fn/date/to-string
|
|
|
677
679
|
core-js(/library)/fn/date/now
|
|
678
680
|
core-js(/library)/fn/date/to-iso-string
|
|
679
681
|
core-js(/library)/fn/date/to-json
|
|
682
|
+
core-js(/library)/fn/date/to-primitive
|
|
680
683
|
```
|
|
681
684
|
[*Example*](http://goo.gl/haeHLR):
|
|
682
685
|
```js
|
|
@@ -684,7 +687,7 @@ new Date(NaN).toString(); // => 'Invalid Date'
|
|
|
684
687
|
```
|
|
685
688
|
|
|
686
689
|
#### ECMAScript 6: Promise
|
|
687
|
-
Module [`es6.promise`](https://github.com/zloirock/core-js/blob/v2.
|
|
690
|
+
Module [`es6.promise`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.promise.js).
|
|
688
691
|
```js
|
|
689
692
|
new Promise(executor(resolve(var), reject(var))) -> promise
|
|
690
693
|
#then(resolved(var), rejected(var)) -> promise
|
|
@@ -804,7 +807,7 @@ setTimeout(() => p.catch(_ => _), 1e3);
|
|
|
804
807
|
```
|
|
805
808
|
|
|
806
809
|
#### ECMAScript 6: Symbol
|
|
807
|
-
Module [`es6.symbol`](https://github.com/zloirock/core-js/blob/v2.
|
|
810
|
+
Module [`es6.symbol`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.symbol.js).
|
|
808
811
|
```js
|
|
809
812
|
Symbol(description?) -> symbol
|
|
810
813
|
.hasInstance -> @@hasInstance
|
|
@@ -916,7 +919,7 @@ for(var key in o2)console.log(key); // nothing
|
|
|
916
919
|
#### ECMAScript 6: Collections
|
|
917
920
|
`core-js` uses native collections in most case, just fixes methods / constructor, if it's required, and in old environment uses fast polyfill (O(1) lookup).
|
|
918
921
|
#### Map
|
|
919
|
-
Module [`es6.map`](https://github.com/zloirock/core-js/blob/v2.
|
|
922
|
+
Module [`es6.map`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.map.js).
|
|
920
923
|
```js
|
|
921
924
|
new Map(iterable (entries) ?) -> map
|
|
922
925
|
#clear() -> void
|
|
@@ -970,7 +973,7 @@ for(var [key, val] of map.entries()){
|
|
|
970
973
|
}
|
|
971
974
|
```
|
|
972
975
|
#### Set
|
|
973
|
-
Module [`es6.set`](https://github.com/zloirock/core-js/blob/v2.
|
|
976
|
+
Module [`es6.set`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.set.js).
|
|
974
977
|
```js
|
|
975
978
|
new Set(iterable?) -> set
|
|
976
979
|
#add(key) -> @
|
|
@@ -1014,7 +1017,7 @@ for(var [key, val] of set.entries()){
|
|
|
1014
1017
|
}
|
|
1015
1018
|
```
|
|
1016
1019
|
#### WeakMap
|
|
1017
|
-
Module [`es6.weak-map`](https://github.com/zloirock/core-js/blob/v2.
|
|
1020
|
+
Module [`es6.weak-map`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.weak-map.js).
|
|
1018
1021
|
```js
|
|
1019
1022
|
new WeakMap(iterable (entries) ?) -> weakmap
|
|
1020
1023
|
#delete(key) -> bool
|
|
@@ -1058,7 +1061,7 @@ console.log(person.getName()); // => 'Vasya'
|
|
|
1058
1061
|
for(var key in person)console.log(key); // => only 'getName'
|
|
1059
1062
|
```
|
|
1060
1063
|
#### WeakSet
|
|
1061
|
-
Module [`es6.weak-set`](https://github.com/zloirock/core-js/blob/v2.
|
|
1064
|
+
Module [`es6.weak-set`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.weak-set.js).
|
|
1062
1065
|
```js
|
|
1063
1066
|
new WeakSet(iterable?) -> weakset
|
|
1064
1067
|
#add(key) -> @
|
|
@@ -1090,7 +1093,7 @@ console.log(wset.has(b)); // => false
|
|
|
1090
1093
|
#### ECMAScript 6: Typed Arrays
|
|
1091
1094
|
Implementations and fixes `ArrayBuffer`, `DataView`, typed arrays constructors, static and prototype methods. Typed Arrays work only in environments with support descriptors (IE9+), `ArrayBuffer` and `DataView` should work anywhere.
|
|
1092
1095
|
|
|
1093
|
-
Modules [`es6.typed.array-buffer`](https://github.com/zloirock/core-js/blob/v2.
|
|
1096
|
+
Modules [`es6.typed.array-buffer`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.array-buffer.js), [`es6.typed.data-view`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.data-view.js), [`es6.typed.int8-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.int8-array.js), [`es6.typed.uint8-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.uint8-array.js), [`es6.typed.uint8-clamped-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.uint8-clamped-array.js), [`es6.typed.int16-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.int16-array.js), [`es6.typed.uint16-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.uint16-array.js), [`es6.typed.int32-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.int32-array.js), [`es6.typed.uint32-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.uint32-array.js), [`es6.typed.float32-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.float32-array.js) and [`es6.typed.float64-array`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.typed.float64-array.js).
|
|
1094
1097
|
```js
|
|
1095
1098
|
new ArrayBuffer(length) -> buffer
|
|
1096
1099
|
.isView(var) -> bool
|
|
@@ -1224,14 +1227,14 @@ for(var [key, val] of typed.entries()){
|
|
|
1224
1227
|
* In the `library` version we can't pollute native prototypes, so prototype methods available as constructors static.
|
|
1225
1228
|
|
|
1226
1229
|
#### ECMAScript 6: Reflect
|
|
1227
|
-
Modules [`es6.reflect.apply`](https://github.com/zloirock/core-js/blob/v2.
|
|
1230
|
+
Modules [`es6.reflect.apply`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.apply.js), [`es6.reflect.construct`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.construct.js), [`es6.reflect.define-property`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.define-property.js), [`es6.reflect.delete-property`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.delete-property.js), [`es6.reflect.enumerate`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.enumerate.js), [`es6.reflect.get`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.get.js), [`es6.reflect.get-own-property-descriptor`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.get-own-property-descriptor.js), [`es6.reflect.get-prototype-of`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.get-prototype-of.js), [`es6.reflect.has`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.has.js), [`es6.reflect.is-extensible`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.is-extensible.js), [`es6.reflect.own-keys`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.own-keys.js), [`es6.reflect.prevent-extensions`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.prevent-extensions.js), [`es6.reflect.set`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.set.js), [`es6.reflect.set-prototype-of`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es6.reflect.set-prototype-of.js).
|
|
1228
1231
|
```js
|
|
1229
1232
|
Reflect
|
|
1230
1233
|
.apply(target, thisArgument, argumentsList) -> var
|
|
1231
1234
|
.construct(target, argumentsList, newTarget?) -> object
|
|
1232
1235
|
.defineProperty(target, propertyKey, attributes) -> bool
|
|
1233
1236
|
.deleteProperty(target, propertyKey) -> bool
|
|
1234
|
-
.enumerate(target) -> iterator (
|
|
1237
|
+
.enumerate(target) -> iterator (removed from the spec and will be removed from core-js@3)
|
|
1235
1238
|
.get(target, propertyKey, receiver?) -> var
|
|
1236
1239
|
.getOwnPropertyDescriptor(target, propertyKey) -> desc
|
|
1237
1240
|
.getPrototypeOf(target) -> object | null
|
|
@@ -1292,23 +1295,30 @@ core-js(/library)/es7/reflect
|
|
|
1292
1295
|
```
|
|
1293
1296
|
`core-js/stage/4` entry point contains only stage 4 proposals, `core-js/stage/3` - stage 3 and stage 4, etc.
|
|
1294
1297
|
##### Stage 4:
|
|
1295
|
-
* `{Array, %TypedArray%}#includes` [proposal](https://github.com/tc39/Array.prototype.includes) - module [`es7.array.includes`](https://github.com/zloirock/core-js/blob/v2.
|
|
1298
|
+
* `{Array, %TypedArray%}#includes` [proposal](https://github.com/tc39/Array.prototype.includes) - module [`es7.array.includes`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.array.includes.js), `%TypedArray%` version in modules from [this section](#ecmascript-6-typed-arrays).
|
|
1299
|
+
* `Object.values`, `Object.entries` [proposal](https://github.com/tc39/proposal-object-values-entries) - modules [`es7.object.values`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.object.values.js), [`es7.object.entries`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.object.entries.js)
|
|
1300
|
+
* `Object#__(define|lookup)[GS]etter__`, [annex B ES2017](https://github.com/tc39/ecma262/pull/381), but we haven't special namespace for that - modules [`es7.object.define-setter`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.object.define-setter.js), [`es7.object.define-getter`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.object.define-getter.js), [`es7.object.lookup-setter`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.object.lookup-setter.js) and [`es7.object.lookup-getter`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.object.lookup-getter.js).
|
|
1296
1301
|
|
|
1297
1302
|
[*CommonJS entry points:*](#commonjs)
|
|
1298
1303
|
```js
|
|
1299
1304
|
core-js(/library)/stage/4
|
|
1300
1305
|
core-js(/library)/fn/array/includes
|
|
1306
|
+
core-js(/library)/fn/object/values
|
|
1307
|
+
core-js(/library)/fn/object/entries
|
|
1308
|
+
core-js(/library)/fn/object/define-getter
|
|
1309
|
+
core-js(/library)/fn/object/define-setter
|
|
1310
|
+
core-js(/library)/fn/object/lookup-getter
|
|
1311
|
+
core-js(/library)/fn/object/lookup-setter
|
|
1301
1312
|
```
|
|
1302
1313
|
|
|
1303
1314
|
##### Stage 3:
|
|
1304
|
-
* `Object.
|
|
1305
|
-
* `String#padStart`, `String#padEnd` [proposal](https://github.com/tc39/proposal-string-pad-start-end) - modules [`es7.string.pad-left`](https://github.com/zloirock/core-js/blob/v2.
|
|
1315
|
+
* `Object.getOwnPropertyDescriptors` [proposal](https://github.com/tc39/proposal-object-getownpropertydescriptors) - module [`es7.object.get-own-property-descriptors`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.object.get-own-property-descriptors.js)
|
|
1316
|
+
* `String#padStart`, `String#padEnd` [proposal](https://github.com/tc39/proposal-string-pad-start-end) - modules [`es7.string.pad-left`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.string.pad-left.js), [`es7.string.pad-right`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.string.pad-right.js)
|
|
1306
1317
|
|
|
1307
1318
|
[*CommonJS entry points:*](#commonjs)
|
|
1308
1319
|
```js
|
|
1309
1320
|
core-js(/library)/stage/3
|
|
1310
|
-
core-js(/library)/fn/object/
|
|
1311
|
-
core-js(/library)/fn/object/entries
|
|
1321
|
+
core-js(/library)/fn/object/get-own-property-descriptors
|
|
1312
1322
|
core-js(/library)/fn/string/pad-start
|
|
1313
1323
|
core-js(/library)/fn/string/pad-end
|
|
1314
1324
|
core-js(/library)/fn/string/virtual/pad-start
|
|
@@ -1316,16 +1326,20 @@ core-js(/library)/fn/string/virtual/pad-end
|
|
|
1316
1326
|
```
|
|
1317
1327
|
|
|
1318
1328
|
##### Stage 2:
|
|
1319
|
-
|
|
1329
|
+
* `System.global` [proposal](https://github.com/tc39/proposal-global) - module [`es7.system.global`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.system.global.js)
|
|
1330
|
+
* `Symbol.asyncIterator` for [async iteration proposal](https://github.com/tc39/proposal-async-iteration) - module [`es7.symbol.async-iterator`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.symbol.async-iterator.js)
|
|
1320
1331
|
|
|
1321
1332
|
[*CommonJS entry points:*](#commonjs)
|
|
1322
1333
|
```js
|
|
1323
1334
|
core-js(/library)/stage/2
|
|
1335
|
+
core-js(/library)/fn/system/global
|
|
1336
|
+
core-js(/library)/fn/symbol/async-iterator
|
|
1324
1337
|
```
|
|
1325
1338
|
|
|
1326
1339
|
##### Stage 1:
|
|
1327
|
-
* `String#trimLeft`, `String#trimRight` / `String#trimStart`, `String#trimEnd` [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim) - modules [`es7.string.trim-left`](https://github.com/zloirock/core-js/blob/v2.
|
|
1328
|
-
* `
|
|
1340
|
+
* `String#trimLeft`, `String#trimRight` / `String#trimStart`, `String#trimEnd` [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim) - modules [`es7.string.trim-left`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.string.trim-right.js), [`es7.string.trim-right`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.string.trim-right.js)
|
|
1341
|
+
* `String#matchAll` [proposal](https://github.com/tc39/String.prototype.matchAll) - module [`es7.string.match-all`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.string.match-all.js)
|
|
1342
|
+
* `Symbol.observable` for [observables proposal](https://github.com/zenparsing/es-observable) - module [`es7.symbol.observable`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.symbol.observable.js)
|
|
1329
1343
|
|
|
1330
1344
|
[*CommonJS entry points:*](#commonjs)
|
|
1331
1345
|
```js
|
|
@@ -1334,26 +1348,27 @@ core-js(/library)/fn/string/trim-start
|
|
|
1334
1348
|
core-js(/library)/fn/string/trim-end
|
|
1335
1349
|
core-js(/library)/fn/string/trim-left
|
|
1336
1350
|
core-js(/library)/fn/string/trim-right
|
|
1351
|
+
core-js(/library)/fn/string/match-all
|
|
1337
1352
|
core-js(/library)/fn/string/virtual/trim-start
|
|
1338
1353
|
core-js(/library)/fn/string/virtual/trim-end
|
|
1339
1354
|
core-js(/library)/fn/string/virtual/trim-left
|
|
1340
1355
|
core-js(/library)/fn/string/virtual/trim-right
|
|
1341
|
-
core-js(/library)/fn/
|
|
1356
|
+
core-js(/library)/fn/string/virtual/match-all
|
|
1357
|
+
core-js(/library)/fn/symbol/observable
|
|
1342
1358
|
```
|
|
1343
1359
|
|
|
1344
1360
|
##### Stage 0:
|
|
1345
|
-
* `String#at` [proposal](https://github.com/mathiasbynens/String.prototype.at) - module [`es7.string.at`](https://github.com/zloirock/core-js/blob/v2.
|
|
1346
|
-
* `
|
|
1347
|
-
* `
|
|
1348
|
-
* `
|
|
1349
|
-
* `
|
|
1361
|
+
* `String#at` [proposal](https://github.com/mathiasbynens/String.prototype.at) - module [`es7.string.at`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.string.at.js)
|
|
1362
|
+
* `Map#toJSON`, `Set#toJSON` [proposal](https://github.com/DavidBruant/Map-Set.prototype.toJSON) - modules [`es7.map.to-json`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.map.to-json.js), [`es7.set.to-json`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.set.to-json.js) (rejected and will be removed from `core-js@3`)
|
|
1363
|
+
* `Error.isError` [proposal](https://github.com/ljharb/proposal-is-error) - module [`es7.error.is-error`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.error.is-error.js) (withdrawn and will be removed from `core-js@3`)
|
|
1364
|
+
* `Math.{iaddh, isubh, imulh, umulh}` [proposal](https://gist.github.com/BrendanEich/4294d5c212a6d2254703) - modules [`es7.math.iaddh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.math.iaddh.js), [`es7.math.isubh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.math.isubh.js), [`es7.math.imulh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.math.imulh.js) and [`es7.math.umulh`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.math.umulh.js)
|
|
1365
|
+
* `glogal.asap`, [TC39 discussion](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask), module [`es7.asap`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.asap.js)
|
|
1350
1366
|
|
|
1351
1367
|
[*CommonJS entry points:*](#commonjs)
|
|
1352
1368
|
```js
|
|
1353
1369
|
core-js(/library)/stage/0
|
|
1354
1370
|
core-js(/library)/fn/string/at
|
|
1355
1371
|
core-js(/library)/fn/string/virtual/at
|
|
1356
|
-
core-js(/library)/fn/object/get-own-property-descriptors
|
|
1357
1372
|
core-js(/library)/fn/map
|
|
1358
1373
|
core-js(/library)/fn/set
|
|
1359
1374
|
core-js(/library)/fn/error/is-error
|
|
@@ -1361,10 +1376,11 @@ core-js(/library)/fn/math/iaddh
|
|
|
1361
1376
|
core-js(/library)/fn/math/isubh
|
|
1362
1377
|
core-js(/library)/fn/math/imulh
|
|
1363
1378
|
core-js(/library)/fn/math/umulh
|
|
1379
|
+
core-js(/library)/fn/asap
|
|
1364
1380
|
```
|
|
1365
1381
|
|
|
1366
1382
|
##### Pre-stage 0 proposals:
|
|
1367
|
-
* `Reflect` metadata [proposal](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) - modules [`es7.reflect.define-metadata`](https://github.com/zloirock/core-js/blob/v2.
|
|
1383
|
+
* `Reflect` metadata [proposal](https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md) - modules [`es7.reflect.define-metadata`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.define-metadata.js), [`es7.reflect.delete-metadata`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.delete-metadata.js), [`es7.reflect.get-metadata`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.get-metadata.js), [`es7.reflect.get-metadata-keys`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.get-metadata-keys.js), [`es7.reflect.get-own-metadata`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.get-own-metadata.js), [`es7.reflect.get-own-metadata-keys`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.get-own-metadata-keys.js), [`es7.reflect.has-metadata`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.has-metadata.js), [`es7.reflect.has-own-metadata`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.has-own-metadata.js) and [`es7.reflect.metadata`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/es7.reflect.metadata.js).
|
|
1368
1384
|
|
|
1369
1385
|
[*CommonJS entry points:*](#commonjs)
|
|
1370
1386
|
```js
|
|
@@ -1381,6 +1397,7 @@ core-js(/library)/fn/reflect/metadata
|
|
|
1381
1397
|
```
|
|
1382
1398
|
|
|
1383
1399
|
```js
|
|
1400
|
+
asap(fn) -> void
|
|
1384
1401
|
Array
|
|
1385
1402
|
#includes(var, from?) -> bool
|
|
1386
1403
|
String
|
|
@@ -1391,20 +1408,26 @@ String
|
|
|
1391
1408
|
#trimRight() -> string
|
|
1392
1409
|
#trimStart() -> string
|
|
1393
1410
|
#trimEnd() -> string
|
|
1411
|
+
#marchAll(regexp) -> iterator
|
|
1394
1412
|
Object
|
|
1395
1413
|
.values(object) -> array
|
|
1396
1414
|
.entries(object) -> array
|
|
1397
1415
|
.getOwnPropertyDescriptors(object) -> object
|
|
1398
|
-
|
|
1399
|
-
|
|
1416
|
+
#__defineSetter__(key, fn) -> void
|
|
1417
|
+
#__defineGetter__(key, fn) -> void
|
|
1418
|
+
#__lookupSetter__(key) -> fn | void
|
|
1419
|
+
#__lookupGetter__(key) -> fn | void
|
|
1400
1420
|
Map
|
|
1401
|
-
#toJSON() -> array
|
|
1421
|
+
#toJSON() -> array (rejected and will be removed from core-js@3)
|
|
1402
1422
|
Set
|
|
1403
|
-
#toJSON() -> array
|
|
1423
|
+
#toJSON() -> array (rejected and will be removed from core-js@3)
|
|
1404
1424
|
System
|
|
1405
1425
|
.global -> object
|
|
1426
|
+
Symbol
|
|
1427
|
+
.asyncIterator -> @@asyncIterator
|
|
1428
|
+
.observable -> @@observable
|
|
1406
1429
|
Error
|
|
1407
|
-
.isError(it) -> bool
|
|
1430
|
+
.isError(it) -> bool (withdrawn and will be removed from core-js@3)
|
|
1408
1431
|
Math
|
|
1409
1432
|
.iaddh(lo0, hi0, lo1, hi1) -> int32
|
|
1410
1433
|
.isubh(lo0, hi0, lo1, hi1) -> int32
|
|
@@ -1421,8 +1444,10 @@ Reflect
|
|
|
1421
1444
|
.getOwnMetadataKeys(target, propertyKey?) -> array
|
|
1422
1445
|
.metadata(metadataKey, metadataValue) -> decorator(target, targetKey?) -> void
|
|
1423
1446
|
```
|
|
1424
|
-
[*Examples*](http://goo.gl/
|
|
1447
|
+
[*Examples*](http://goo.gl/DVGima):
|
|
1425
1448
|
```js
|
|
1449
|
+
asap(() => console.log('called as microtask'));
|
|
1450
|
+
|
|
1426
1451
|
[1, 2, 3].includes(2); // => true
|
|
1427
1452
|
[1, 2, 3].includes(4); // => false
|
|
1428
1453
|
[1, 2, 3].includes(2, 2); // => false
|
|
@@ -1443,6 +1468,10 @@ Array(1).includes(undefined); // => true
|
|
|
1443
1468
|
' hello '.trimLeft(); // => 'hello '
|
|
1444
1469
|
' hello '.trimRight(); // => ' hello'
|
|
1445
1470
|
|
|
1471
|
+
for(let [_, d, D] of '1111a2b3cccc'.matchAll(/(\d)(\D)/)){
|
|
1472
|
+
console.log(d, D); // => 1 a, 2 b, 3 c
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1446
1475
|
Object.values({a: 1, b: 2, c: 3}); // => [1, 2, 3]
|
|
1447
1476
|
Object.entries({a: 1, b: 2, c: 3}); // => [['a', 1], ['b', 2], ['c', 3]]
|
|
1448
1477
|
|
|
@@ -1451,13 +1480,8 @@ var copy = Object.create(Object.getPrototypeOf(O), Object.getOwnPropertyDescript
|
|
|
1451
1480
|
// Mixin:
|
|
1452
1481
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1453
1482
|
|
|
1454
|
-
JSON.stringify(new Map([['a', 'b'], ['c', 'd']])); // => '[["a","b"],["c","d"]]'
|
|
1455
|
-
JSON.stringify(new Set([1, 2, 3, 2, 1])); // => '[1,2,3]'
|
|
1456
|
-
|
|
1457
1483
|
System.global.Array === Array; // => true
|
|
1458
1484
|
|
|
1459
|
-
Error.isError(new TypeError); // => true
|
|
1460
|
-
|
|
1461
1485
|
var O = {};
|
|
1462
1486
|
Reflect.defineMetadata('foo', 'bar', O);
|
|
1463
1487
|
Reflect.ownKeys(O); // => []
|
|
@@ -1470,7 +1494,7 @@ Reflect.getOwnMetadata('foo', O); // => 'bar'
|
|
|
1470
1494
|
core-js(/library)/web
|
|
1471
1495
|
```
|
|
1472
1496
|
#### setTimeout / setInterval
|
|
1473
|
-
Module [`web.timers`](https://github.com/zloirock/core-js/blob/v2.
|
|
1497
|
+
Module [`web.timers`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/web.timers.js). Additional arguments fix for IE9-.
|
|
1474
1498
|
```js
|
|
1475
1499
|
setTimeout(fn(...args), time, ...args) -> id
|
|
1476
1500
|
setInterval(fn(...args), time, ...args) -> id
|
|
@@ -1488,7 +1512,7 @@ setTimeout(log.bind(null, 42), 1000);
|
|
|
1488
1512
|
setTimeout(log, 1000, 42);
|
|
1489
1513
|
```
|
|
1490
1514
|
#### setImmediate
|
|
1491
|
-
Module [`web.immediate`](https://github.com/zloirock/core-js/blob/v2.
|
|
1515
|
+
Module [`web.immediate`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/web.immediate.js). [`setImmediate` proposal](https://developer.mozilla.org/en-US/docs/Web/API/Window.setImmediate) polyfill.
|
|
1492
1516
|
```js
|
|
1493
1517
|
setImmediate(fn(...args), ...args) -> id
|
|
1494
1518
|
clearImmediate(id) -> void
|
|
@@ -1510,7 +1534,7 @@ clearImmediate(setImmediate(function(){
|
|
|
1510
1534
|
}));
|
|
1511
1535
|
```
|
|
1512
1536
|
#### Iterable DOM collections
|
|
1513
|
-
Some DOM collections should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass). That mean they should have `keys`, `values`, `entries` and `@@iterator` methods for iteration. So add them. Module [`web.dom.iterable`](https://github.com/zloirock/core-js/blob/v2.
|
|
1537
|
+
Some DOM collections should have [iterable interface](https://heycam.github.io/webidl/#idl-iterable) or should be [inherited from `Array`](https://heycam.github.io/webidl/#LegacyArrayClass). That mean they should have `keys`, `values`, `entries` and `@@iterator` methods for iteration. So add them. Module [`web.dom.iterable`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/web.dom.iterable.js):
|
|
1514
1538
|
```js
|
|
1515
1539
|
{
|
|
1516
1540
|
NodeList,
|
|
@@ -1545,7 +1569,7 @@ for(var [index, {id}] of document.querySelectorAll('*').entries()){
|
|
|
1545
1569
|
core-js(/library)/core
|
|
1546
1570
|
```
|
|
1547
1571
|
#### Object
|
|
1548
|
-
Modules [`core.object.is-object`](https://github.com/zloirock/core-js/blob/v2.
|
|
1572
|
+
Modules [`core.object.is-object`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.object.is-object.js), [`core.object.classof`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.object.classof.js), [`core.object.define`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.object.define.js), [`core.object.make`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.object.make.js).
|
|
1549
1573
|
```js
|
|
1550
1574
|
Object
|
|
1551
1575
|
.isObject(var) -> bool
|
|
@@ -1658,7 +1682,7 @@ console.log(vector.xy); // => 15.811388300841896
|
|
|
1658
1682
|
console.log(vector.xyz); // => 25.495097567963924
|
|
1659
1683
|
```
|
|
1660
1684
|
#### Dict
|
|
1661
|
-
Module [`core.dict`](https://github.com/zloirock/core-js/blob/v2.
|
|
1685
|
+
Module [`core.dict`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.dict.js). Based on [TC39 discuss](https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-11/nov-29.md#collection-apis-review) / [strawman](http://wiki.ecmascript.org/doku.php?id=harmony:modules_standard#dictionaries).
|
|
1662
1686
|
```js
|
|
1663
1687
|
[new] Dict(iterable (entries) | object ?) -> dict
|
|
1664
1688
|
.isDict(var) -> bool
|
|
@@ -1811,7 +1835,7 @@ Dict.reduce(dict, function(memo, it){
|
|
|
1811
1835
|
}, ''); // => '123'
|
|
1812
1836
|
```
|
|
1813
1837
|
#### Partial application
|
|
1814
|
-
Module [`core.function.part`](https://github.com/zloirock/core-js/blob/v2.
|
|
1838
|
+
Module [`core.function.part`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.function.part.js).
|
|
1815
1839
|
```js
|
|
1816
1840
|
Function
|
|
1817
1841
|
#part(...args | _) -> fn(...args)
|
|
@@ -1841,7 +1865,7 @@ fn2(1, 3, 5); // => 1, 2, 3, 4, 5
|
|
|
1841
1865
|
fn2(1); // => 1, 2, undefined, 4
|
|
1842
1866
|
```
|
|
1843
1867
|
#### Number Iterator
|
|
1844
|
-
Module [`core.number.iterator`](https://github.com/zloirock/core-js/blob/v2.
|
|
1868
|
+
Module [`core.number.iterator`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.number.iterator.js).
|
|
1845
1869
|
```js
|
|
1846
1870
|
Number
|
|
1847
1871
|
#@@iterator() -> iterator
|
|
@@ -1866,7 +1890,7 @@ Array.from(10, function(it){
|
|
|
1866
1890
|
}, .42); // => [0.42, 1.42, 4.42, 9.42, 16.42, 25.42, 36.42, 49.42, 64.42, 81.42]
|
|
1867
1891
|
```
|
|
1868
1892
|
#### Escaping strings
|
|
1869
|
-
Modules [`core.regexp.escape`](https://github.com/zloirock/core-js/blob/v2.
|
|
1893
|
+
Modules [`core.regexp.escape`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.regexp.escape.js), [`core.string.escape-html`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.string.escape-html.js) and [`core.string.unescape-html`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.string.unescape-html.js).
|
|
1870
1894
|
```js
|
|
1871
1895
|
RegExp
|
|
1872
1896
|
.escape(str) -> str
|
|
@@ -1892,7 +1916,7 @@ RegExp.escape('Hello, []{}()*+?.\\^$|!'); // => 'Hello, \[\]\{\}\(\)\*\+\?\.\\\^
|
|
|
1892
1916
|
'<script>doSomething();</script>'.unescapeHTML(); // => '<script>doSomething();</script>'
|
|
1893
1917
|
```
|
|
1894
1918
|
#### delay
|
|
1895
|
-
Module [`core.delay`](https://github.com/zloirock/core-js/blob/v2.
|
|
1919
|
+
Module [`core.delay`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.delay.js). [Promise](#ecmascript-6-promise)-returning delay function, [esdiscuss](https://esdiscuss.org/topic/promise-returning-delay-function).
|
|
1896
1920
|
```js
|
|
1897
1921
|
delay(ms) -> promise
|
|
1898
1922
|
```
|
|
@@ -1908,12 +1932,12 @@ delay(1e3).then(() => console.log('after 1 sec'));
|
|
|
1908
1932
|
(async () => {
|
|
1909
1933
|
await delay(3e3);
|
|
1910
1934
|
console.log('after 3 sec');
|
|
1911
|
-
|
|
1935
|
+
|
|
1912
1936
|
while(await delay(3e3))console.log('each 3 sec');
|
|
1913
1937
|
})();
|
|
1914
1938
|
```
|
|
1915
1939
|
#### Helpers for iterators
|
|
1916
|
-
Modules [`core.is-iterable`](https://github.com/zloirock/core-js/blob/v2.
|
|
1940
|
+
Modules [`core.is-iterable`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.is-iterable.js), [`core.get-iterator`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.get-iterator.js), [`core.get-iterator-method`](https://github.com/zloirock/core-js/blob/v2.3.0/modules/core.get-iterator-method.js) - helpers for check iterability / get iterator in the `library` version or, for example, for `arguments` object:
|
|
1917
1941
|
```js
|
|
1918
1942
|
core
|
|
1919
1943
|
.isIterable(var) -> bool
|
|
@@ -1959,4 +1983,5 @@ console.log(core.getIteratorMethod({})); // undefined
|
|
|
1959
1983
|
- ES6 `Proxy` can't be polyfilled, but for Node.js / Chromium with additional flags you can try [harmony-reflect](https://github.com/tvcutsem/harmony-reflect) for adapt old style `Proxy` API to final ES6 version.
|
|
1960
1984
|
- ES6 logic for `@@isConcatSpreadable` and `@@species` (in most places) can be polyfilled without problems, but it will cause a serious slowdown in popular cases in some engines. It will be polyfilled when it will be implemented in modern engines.
|
|
1961
1985
|
- ES7 `SIMD`. `core-js` doesn't add polyfill of this feature because of large size and some other reasons. You can use [this polyfill](https://github.com/tc39/ecmascript_simd/blob/master/src/ecmascript_simd.js).
|
|
1962
|
-
- `window.fetch` is not a cross-platform feature, in some environments it
|
|
1986
|
+
- `window.fetch` is not a cross-platform feature, in some environments it makes no sense. For this reason, I don't think it should be in `core-js`. Looking at a large number of requests it *may be* added in the future. Now you can use, for example, [this polyfill](https://github.com/github/fetch).
|
|
1987
|
+
- ECMA-402 `Intl` is missed because of size. You can use [this polyfill](https://github.com/andyearnshaw/Intl.js/).
|