core-js 3.7.0 → 3.8.3
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/LICENSE +1 -1
- package/README.md +3 -2
- package/es/array/virtual/filter-out.js +4 -0
- package/es/instance/replace-all.js +9 -0
- package/es/promise/all-settled.js +2 -0
- package/es/promise/any.js +2 -0
- package/features/array/at.js +4 -0
- package/features/array/filter-out.js +4 -0
- package/features/array/index.js +4 -0
- package/features/array/unique-by.js +5 -0
- package/features/array/virtual/at.js +4 -0
- package/features/array/virtual/filter-out.js +4 -0
- package/features/array/virtual/index.js +3 -0
- package/features/array/virtual/unique-by.js +5 -0
- package/features/bigint/index.js +4 -0
- package/features/bigint/range.js +4 -0
- package/features/instance/at.js +7 -3
- package/features/instance/filter-out.js +8 -0
- package/features/instance/replace-all.js +2 -8
- package/features/instance/unique-by.js +8 -0
- package/features/number/index.js +1 -0
- package/features/number/range.js +4 -0
- package/features/string/index.js +2 -0
- package/features/string/virtual/index.js +2 -0
- package/features/typed-array/at.js +1 -0
- package/features/typed-array/filter-out.js +1 -0
- package/features/typed-array/index.js +2 -0
- package/internals/add-to-unscopables.js +1 -1
- package/internals/advance-string-index.js +1 -1
- package/internals/array-buffer-view-core.js +13 -2
- package/internals/array-copy-within.js +1 -1
- package/internals/array-fill.js +1 -1
- package/internals/array-for-each.js +1 -1
- package/internals/array-from.js +1 -1
- package/internals/array-includes.js +2 -2
- package/internals/array-iteration.js +18 -11
- package/internals/array-last-index-of.js +1 -1
- package/internals/array-reduce.js +2 -2
- package/internals/array-species-create.js +1 -1
- package/internals/create-html.js +1 -1
- package/internals/date-to-iso-string.js +1 -1
- package/internals/descriptors.js +1 -1
- package/internals/engine-is-webos-webkit.js +3 -0
- package/internals/function-bind.js +1 -1
- package/internals/get-substitution.js +40 -0
- package/internals/is-array.js +1 -1
- package/internals/is-integer.js +1 -1
- package/internals/is-regexp.js +1 -1
- package/internals/iterators-core.js +10 -3
- package/internals/math-expm1.js +1 -1
- package/internals/math-fround.js +1 -1
- package/internals/math-log1p.js +1 -1
- package/internals/math-sign.js +1 -1
- package/internals/microtask.js +3 -1
- package/internals/number-is-finite.js +1 -1
- package/internals/number-parse-float.js +1 -1
- package/internals/number-parse-int.js +1 -1
- package/internals/object-assign.js +1 -1
- package/internals/object-create.js +1 -1
- package/internals/object-define-properties.js +1 -1
- package/internals/object-define-property.js +1 -1
- package/internals/object-get-own-property-descriptor.js +1 -1
- package/internals/object-get-own-property-names.js +1 -1
- package/internals/object-get-prototype-of.js +1 -1
- package/internals/object-keys.js +1 -1
- package/internals/object-property-is-enumerable.js +1 -1
- package/internals/object-set-prototype-of.js +1 -1
- package/internals/object-to-array.js +2 -2
- package/internals/object-to-string.js +1 -1
- package/internals/range-iterator.js +102 -0
- package/internals/regexp-exec-abstract.js +1 -1
- package/internals/regexp-flags.js +1 -1
- package/internals/require-object-coercible.js +1 -1
- package/internals/same-value-zero.js +1 -1
- package/internals/same-value.js +1 -1
- package/internals/shared.js +2 -2
- package/internals/species-constructor.js +1 -1
- package/internals/string-multibyte.js +1 -1
- package/internals/string-pad.js +2 -2
- package/internals/string-repeat.js +1 -1
- package/internals/string-trim.js +3 -3
- package/internals/this-number-value.js +1 -1
- package/internals/to-index.js +1 -1
- package/internals/to-integer.js +1 -1
- package/internals/to-length.js +1 -1
- package/internals/to-object.js +1 -1
- package/internals/to-primitive.js +1 -1
- package/modules/es.aggregate-error.js +3 -0
- package/modules/es.array-buffer.constructor.js +1 -1
- package/modules/es.array-buffer.is-view.js +1 -1
- package/modules/es.array-buffer.slice.js +1 -1
- package/modules/es.array.concat.js +1 -1
- package/modules/es.array.copy-within.js +2 -2
- package/modules/es.array.every.js +1 -1
- package/modules/es.array.fill.js +2 -2
- package/modules/es.array.filter.js +1 -1
- package/modules/es.array.find-index.js +2 -2
- package/modules/es.array.find.js +2 -2
- package/modules/es.array.flat-map.js +1 -1
- package/modules/es.array.flat.js +1 -1
- package/modules/es.array.for-each.js +1 -1
- package/modules/es.array.from.js +1 -1
- package/modules/es.array.includes.js +2 -2
- package/modules/es.array.index-of.js +1 -1
- package/modules/es.array.is-array.js +1 -1
- package/modules/es.array.iterator.js +9 -9
- package/modules/es.array.join.js +1 -1
- package/modules/es.array.last-index-of.js +1 -1
- package/modules/es.array.map.js +1 -1
- package/modules/es.array.of.js +1 -1
- package/modules/es.array.reduce-right.js +1 -1
- package/modules/es.array.reduce.js +1 -1
- package/modules/es.array.reverse.js +1 -1
- package/modules/es.array.slice.js +1 -1
- package/modules/es.array.some.js +1 -1
- package/modules/es.array.sort.js +1 -1
- package/modules/es.array.species.js +1 -1
- package/modules/es.array.splice.js +1 -1
- package/modules/es.array.unscopables.flat-map.js +1 -0
- package/modules/es.array.unscopables.flat.js +1 -0
- package/modules/es.data-view.js +1 -1
- package/modules/es.date.now.js +1 -1
- package/modules/es.date.to-iso-string.js +1 -1
- package/modules/es.date.to-json.js +1 -1
- package/modules/es.date.to-primitive.js +1 -1
- package/modules/es.date.to-string.js +1 -1
- package/modules/es.function.bind.js +1 -1
- package/modules/es.function.has-instance.js +1 -1
- package/modules/es.function.name.js +1 -1
- package/modules/es.global-this.js +1 -1
- package/modules/es.json.stringify.js +2 -0
- package/modules/es.json.to-string-tag.js +1 -1
- package/modules/es.map.js +1 -1
- package/modules/es.math.acosh.js +1 -1
- package/modules/es.math.asinh.js +1 -1
- package/modules/es.math.atanh.js +1 -1
- package/modules/es.math.cbrt.js +1 -1
- package/modules/es.math.clz32.js +1 -1
- package/modules/es.math.cosh.js +1 -1
- package/modules/es.math.expm1.js +1 -1
- package/modules/es.math.fround.js +1 -1
- package/modules/es.math.hypot.js +1 -1
- package/modules/es.math.imul.js +1 -1
- package/modules/es.math.log10.js +1 -1
- package/modules/es.math.log1p.js +1 -1
- package/modules/es.math.log2.js +1 -1
- package/modules/es.math.sign.js +1 -1
- package/modules/es.math.sinh.js +1 -1
- package/modules/es.math.tanh.js +1 -1
- package/modules/es.math.to-string-tag.js +1 -1
- package/modules/es.math.trunc.js +1 -1
- package/modules/es.number.constructor.js +5 -3
- package/modules/es.number.epsilon.js +1 -1
- package/modules/es.number.is-finite.js +1 -1
- package/modules/es.number.is-integer.js +1 -1
- package/modules/es.number.is-nan.js +1 -1
- package/modules/es.number.is-safe-integer.js +1 -1
- package/modules/es.number.max-safe-integer.js +1 -1
- package/modules/es.number.min-safe-integer.js +1 -1
- package/modules/es.number.parse-float.js +1 -1
- package/modules/es.number.parse-int.js +1 -1
- package/modules/es.number.to-fixed.js +1 -1
- package/modules/es.number.to-precision.js +1 -1
- package/modules/es.object.assign.js +1 -1
- package/modules/es.object.create.js +1 -1
- package/modules/es.object.define-getter.js +1 -1
- package/modules/es.object.define-properties.js +1 -1
- package/modules/es.object.define-property.js +1 -1
- package/modules/es.object.define-setter.js +1 -1
- package/modules/es.object.entries.js +1 -1
- package/modules/es.object.freeze.js +1 -1
- package/modules/es.object.get-own-property-descriptor.js +1 -1
- package/modules/es.object.get-own-property-descriptors.js +1 -1
- package/modules/es.object.get-own-property-names.js +1 -1
- package/modules/es.object.get-prototype-of.js +1 -1
- package/modules/es.object.is-extensible.js +1 -1
- package/modules/es.object.is-frozen.js +1 -1
- package/modules/es.object.is-sealed.js +1 -1
- package/modules/es.object.is.js +1 -1
- package/modules/es.object.keys.js +1 -1
- package/modules/es.object.lookup-getter.js +1 -1
- package/modules/es.object.lookup-setter.js +1 -1
- package/modules/es.object.prevent-extensions.js +1 -1
- package/modules/es.object.seal.js +1 -1
- package/modules/es.object.set-prototype-of.js +1 -1
- package/modules/es.object.to-string.js +1 -1
- package/modules/es.object.values.js +1 -1
- package/modules/es.parse-float.js +1 -1
- package/modules/es.parse-int.js +1 -1
- package/modules/es.promise.all-settled.js +1 -1
- package/modules/es.promise.any.js +1 -1
- package/modules/es.promise.finally.js +1 -1
- package/modules/es.promise.js +6 -6
- package/modules/es.reflect.apply.js +1 -1
- package/modules/es.reflect.construct.js +1 -1
- package/modules/es.reflect.define-property.js +1 -1
- package/modules/es.reflect.delete-property.js +1 -1
- package/modules/es.reflect.get-own-property-descriptor.js +1 -1
- package/modules/es.reflect.get-prototype-of.js +1 -1
- package/modules/es.reflect.get.js +1 -1
- package/modules/es.reflect.has.js +1 -1
- package/modules/es.reflect.is-extensible.js +1 -1
- package/modules/es.reflect.own-keys.js +1 -1
- package/modules/es.reflect.prevent-extensions.js +1 -1
- package/modules/es.reflect.set-prototype-of.js +1 -1
- package/modules/es.reflect.set.js +1 -1
- package/modules/es.regexp.constructor.js +2 -2
- package/modules/es.regexp.exec.js +2 -0
- package/modules/es.regexp.flags.js +1 -1
- package/modules/es.regexp.sticky.js +1 -0
- package/modules/es.regexp.test.js +2 -0
- package/modules/es.regexp.to-string.js +1 -1
- package/modules/es.set.js +1 -1
- package/modules/es.string.anchor.js +1 -1
- package/modules/es.string.big.js +1 -1
- package/modules/es.string.blink.js +1 -1
- package/modules/es.string.bold.js +1 -1
- package/modules/es.string.code-point-at.js +1 -1
- package/modules/es.string.ends-with.js +1 -1
- package/modules/es.string.fixed.js +1 -1
- package/modules/es.string.fontcolor.js +1 -1
- package/modules/es.string.fontsize.js +1 -1
- package/modules/es.string.from-code-point.js +1 -1
- package/modules/es.string.includes.js +1 -1
- package/modules/es.string.italics.js +1 -1
- package/modules/es.string.iterator.js +2 -2
- package/modules/es.string.link.js +1 -1
- package/modules/es.string.match-all.js +1 -1
- package/modules/es.string.match.js +2 -2
- package/modules/es.string.pad-end.js +1 -1
- package/modules/es.string.pad-start.js +1 -1
- package/modules/es.string.raw.js +1 -1
- package/modules/es.string.repeat.js +1 -1
- package/modules/es.string.replace-all.js +29 -12
- package/modules/es.string.replace.js +3 -40
- package/modules/es.string.search.js +2 -2
- package/modules/es.string.small.js +1 -1
- package/modules/es.string.split.js +2 -2
- package/modules/es.string.starts-with.js +1 -1
- package/modules/es.string.strike.js +1 -1
- package/modules/es.string.sub.js +1 -1
- package/modules/es.string.sup.js +1 -1
- package/modules/es.string.trim-end.js +2 -1
- package/modules/es.string.trim-start.js +2 -1
- package/modules/es.string.trim.js +1 -1
- package/modules/es.symbol.async-iterator.js +1 -1
- package/modules/es.symbol.description.js +1 -1
- package/modules/es.symbol.has-instance.js +1 -1
- package/modules/es.symbol.is-concat-spreadable.js +1 -1
- package/modules/es.symbol.iterator.js +1 -1
- package/modules/es.symbol.js +12 -12
- package/modules/es.symbol.match-all.js +1 -0
- package/modules/es.symbol.match.js +1 -1
- package/modules/es.symbol.replace.js +1 -1
- package/modules/es.symbol.search.js +1 -1
- package/modules/es.symbol.species.js +1 -1
- package/modules/es.symbol.split.js +1 -1
- package/modules/es.symbol.to-primitive.js +1 -1
- package/modules/es.symbol.to-string-tag.js +1 -1
- package/modules/es.symbol.unscopables.js +1 -1
- package/modules/es.typed-array.copy-within.js +1 -1
- package/modules/es.typed-array.every.js +1 -1
- package/modules/es.typed-array.fill.js +1 -1
- package/modules/es.typed-array.filter.js +1 -1
- package/modules/es.typed-array.find-index.js +1 -1
- package/modules/es.typed-array.find.js +1 -1
- package/modules/es.typed-array.float32-array.js +1 -1
- package/modules/es.typed-array.float64-array.js +1 -1
- package/modules/es.typed-array.for-each.js +1 -1
- package/modules/es.typed-array.from.js +1 -1
- package/modules/es.typed-array.includes.js +1 -1
- package/modules/es.typed-array.index-of.js +1 -1
- package/modules/es.typed-array.int16-array.js +1 -1
- package/modules/es.typed-array.int32-array.js +1 -1
- package/modules/es.typed-array.int8-array.js +1 -1
- package/modules/es.typed-array.iterator.js +4 -4
- package/modules/es.typed-array.join.js +1 -1
- package/modules/es.typed-array.last-index-of.js +1 -1
- package/modules/es.typed-array.map.js +1 -1
- package/modules/es.typed-array.of.js +1 -1
- package/modules/es.typed-array.reduce-right.js +1 -1
- package/modules/es.typed-array.reduce.js +1 -1
- package/modules/es.typed-array.reverse.js +1 -1
- package/modules/es.typed-array.set.js +1 -1
- package/modules/es.typed-array.slice.js +1 -1
- package/modules/es.typed-array.some.js +1 -1
- package/modules/es.typed-array.sort.js +1 -1
- package/modules/es.typed-array.subarray.js +1 -1
- package/modules/es.typed-array.to-locale-string.js +1 -1
- package/modules/es.typed-array.to-string.js +1 -1
- package/modules/es.typed-array.uint16-array.js +1 -1
- package/modules/es.typed-array.uint32-array.js +1 -1
- package/modules/es.typed-array.uint8-array.js +1 -1
- package/modules/es.typed-array.uint8-clamped-array.js +1 -1
- package/modules/es.weak-map.js +1 -1
- package/modules/es.weak-set.js +1 -1
- package/modules/esnext.array.at.js +20 -0
- package/modules/esnext.array.filter-out.js +14 -0
- package/modules/esnext.array.unique-by.js +38 -0
- package/modules/esnext.bigint.range.js +14 -0
- package/modules/esnext.number.range.js +11 -0
- package/modules/esnext.string.at-alternative.js +23 -0
- package/modules/esnext.string.at.js +6 -1
- package/modules/esnext.typed-array.at.js +17 -0
- package/modules/esnext.typed-array.filter-out.js +20 -0
- package/package.json +3 -2
- package/proposals/array-filtering.js +3 -0
- package/proposals/array-unique.js +3 -0
- package/proposals/number-range.js +3 -0
- package/proposals/relative-indexing-method.js +5 -0
- package/stable/instance/replace-all.js +3 -0
- package/stage/1.js +3 -0
- package/stage/3.js +1 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# core-js
|
|
2
2
|
|
|
3
|
-
[](#sponsors) [](#backers) [](https://gitter.im/zloirock/core-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://www.npmjs.com/package/core-js) [](http://npm-stat.com/charts.html?package=core-js&author=&from=2014-11-18) [](#sponsors) [](#backers) [](https://gitter.im/zloirock/core-js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://www.npmjs.com/package/core-js) [](http://npm-stat.com/charts.html?package=core-js&author=&from=2014-11-18) [](https://github.com/zloirock/core-js/actions)
|
|
4
|
+
[](https://github.com/zloirock/core-js/actions)
|
|
4
5
|
|
|
5
|
-
> Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to
|
|
6
|
+
> Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to 2021](https://github.com/zloirock/core-js#ecmascript): [promises](https://github.com/zloirock/core-js#ecmascript-promise), [symbols](https://github.com/zloirock/core-js#ecmascript-symbol), [collections](https://github.com/zloirock/core-js#ecmascript-collections), iterators, [typed arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays), many other features, [ECMAScript proposals](https://github.com/zloirock/core-js#ecmascript-proposals), [some cross-platform WHATWG / W3C features and proposals](#web-standards) like [`URL`](https://github.com/zloirock/core-js#url-and-urlsearchparams). You can load only required features or use it without global namespace pollution.
|
|
6
7
|
|
|
7
8
|
## As advertising: the author is looking for a good job -)
|
|
8
9
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var replaceAll = require('../string/virtual/replace-all');
|
|
2
|
+
|
|
3
|
+
var StringPrototype = String.prototype;
|
|
4
|
+
|
|
5
|
+
module.exports = function (it) {
|
|
6
|
+
var own = it.replaceAll;
|
|
7
|
+
return typeof it === 'string' || it === StringPrototype
|
|
8
|
+
|| (it instanceof String && own === StringPrototype.replaceAll) ? replaceAll : own;
|
|
9
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
require('../../modules/es.promise');
|
|
3
3
|
require('../../modules/es.promise.all-settled');
|
|
4
|
+
require('../../modules/es.string.iterator');
|
|
5
|
+
require('../../modules/web.dom-collections.iterator');
|
|
4
6
|
var path = require('../../internals/path');
|
|
5
7
|
|
|
6
8
|
var Promise = path.Promise;
|
package/es/promise/any.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
require('../../modules/es.aggregate-error');
|
|
3
3
|
require('../../modules/es.promise');
|
|
4
4
|
require('../../modules/es.promise.any');
|
|
5
|
+
require('../../modules/es.string.iterator');
|
|
6
|
+
require('../../modules/web.dom-collections.iterator');
|
|
5
7
|
var path = require('../../internals/path');
|
|
6
8
|
|
|
7
9
|
var Promise = path.Promise;
|
package/features/array/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
var parent = require('../../es/array');
|
|
2
|
+
require('../../modules/es.map');
|
|
3
|
+
require('../../modules/esnext.array.at');
|
|
4
|
+
require('../../modules/esnext.array.filter-out');
|
|
2
5
|
require('../../modules/esnext.array.is-template-object');
|
|
3
6
|
require('../../modules/esnext.array.last-item');
|
|
4
7
|
require('../../modules/esnext.array.last-index');
|
|
8
|
+
require('../../modules/esnext.array.unique-by');
|
|
5
9
|
|
|
6
10
|
module.exports = parent;
|
package/features/instance/at.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var arrayAt = require('../array/virtual/at');
|
|
2
|
+
var stringAt = require('../string/virtual/at');
|
|
2
3
|
|
|
4
|
+
var ArrayPrototype = Array.prototype;
|
|
3
5
|
var StringPrototype = String.prototype;
|
|
4
6
|
|
|
5
7
|
module.exports = function (it) {
|
|
6
8
|
var own = it.at;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.at)) return arrayAt;
|
|
10
|
+
if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.at)) {
|
|
11
|
+
return stringAt;
|
|
12
|
+
} return own;
|
|
9
13
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var filterOut = require('../array/virtual/filter-out');
|
|
2
|
+
|
|
3
|
+
var ArrayPrototype = Array.prototype;
|
|
4
|
+
|
|
5
|
+
module.exports = function (it) {
|
|
6
|
+
var own = it.filterOut;
|
|
7
|
+
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filterOut) ? filterOut : own;
|
|
8
|
+
};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var parent = require('../../stable/instance/replace-all');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = function (it) {
|
|
6
|
-
var own = it.replaceAll;
|
|
7
|
-
return typeof it === 'string' || it === StringPrototype
|
|
8
|
-
|| (it instanceof String && own === StringPrototype.replaceAll) ? replaceAll : own;
|
|
9
|
-
};
|
|
3
|
+
module.exports = parent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var uniqueBy = require('../array/virtual/unique-by');
|
|
2
|
+
|
|
3
|
+
var ArrayPrototype = Array.prototype;
|
|
4
|
+
|
|
5
|
+
module.exports = function (it) {
|
|
6
|
+
var own = it.uniqueBy;
|
|
7
|
+
return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.uniqueBy) ? uniqueBy : own;
|
|
8
|
+
};
|
package/features/number/index.js
CHANGED
package/features/string/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var parent = require('../../es/string');
|
|
2
2
|
require('../../modules/esnext.string.at');
|
|
3
|
+
// TODO: disabled by default because of the conflict with another proposal
|
|
4
|
+
// require('../../modules/esnext.string.at-alternative');
|
|
3
5
|
require('../../modules/esnext.string.code-points');
|
|
4
6
|
// TODO: remove from `core-js@4`
|
|
5
7
|
require('../../modules/esnext.string.match-all');
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var parent = require('../../../es/string/virtual');
|
|
2
2
|
require('../../../modules/esnext.string.at');
|
|
3
|
+
// TODO: disabled by default because of the conflict with another proposal
|
|
4
|
+
// require('../../../modules/esnext.string.at-alternative');
|
|
3
5
|
require('../../../modules/esnext.string.code-points');
|
|
4
6
|
// TODO: remove from `core-js@4`
|
|
5
7
|
require('../../../modules/esnext.string.match-all');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../modules/esnext.typed-array.at');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../../modules/esnext.typed-array.filter-out');
|
|
@@ -6,7 +6,7 @@ var UNSCOPABLES = wellKnownSymbol('unscopables');
|
|
|
6
6
|
var ArrayPrototype = Array.prototype;
|
|
7
7
|
|
|
8
8
|
// Array.prototype[@@unscopables]
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
10
10
|
if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
|
11
11
|
definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
|
|
12
12
|
configurable: true,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var charAt = require('../internals/string-multibyte').charAt;
|
|
3
3
|
|
|
4
4
|
// `AdvanceStringIndex` abstract operation
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-advancestringindex
|
|
6
6
|
module.exports = function (S, index, unicode) {
|
|
7
7
|
return index + (unicode ? charAt(S, index).length : 1);
|
|
8
8
|
};
|
|
@@ -41,13 +41,24 @@ var TypedArrayConstructorsList = {
|
|
|
41
41
|
Float64Array: 8
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
var BigIntArrayConstructorsList = {
|
|
45
|
+
BigInt64Array: 8,
|
|
46
|
+
BigUint64Array: 8
|
|
47
|
+
};
|
|
48
|
+
|
|
44
49
|
var isView = function isView(it) {
|
|
50
|
+
if (!isObject(it)) return false;
|
|
45
51
|
var klass = classof(it);
|
|
46
|
-
return klass === 'DataView'
|
|
52
|
+
return klass === 'DataView'
|
|
53
|
+
|| has(TypedArrayConstructorsList, klass)
|
|
54
|
+
|| has(BigIntArrayConstructorsList, klass);
|
|
47
55
|
};
|
|
48
56
|
|
|
49
57
|
var isTypedArray = function (it) {
|
|
50
|
-
|
|
58
|
+
if (!isObject(it)) return false;
|
|
59
|
+
var klass = classof(it);
|
|
60
|
+
return has(TypedArrayConstructorsList, klass)
|
|
61
|
+
|| has(BigIntArrayConstructorsList, klass);
|
|
51
62
|
};
|
|
52
63
|
|
|
53
64
|
var aTypedArray = function (it) {
|
|
@@ -6,7 +6,7 @@ var toLength = require('../internals/to-length');
|
|
|
6
6
|
var min = Math.min;
|
|
7
7
|
|
|
8
8
|
// `Array.prototype.copyWithin` method implementation
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-array.prototype.copywithin
|
|
10
10
|
module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
|
|
11
11
|
var O = toObject(this);
|
|
12
12
|
var len = toLength(O.length);
|
package/internals/array-fill.js
CHANGED
|
@@ -4,7 +4,7 @@ var toAbsoluteIndex = require('../internals/to-absolute-index');
|
|
|
4
4
|
var toLength = require('../internals/to-length');
|
|
5
5
|
|
|
6
6
|
// `Array.prototype.fill` method implementation
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-array.prototype.fill
|
|
8
8
|
module.exports = function fill(value /* , start = 0, end = @length */) {
|
|
9
9
|
var O = toObject(this);
|
|
10
10
|
var length = toLength(O.length);
|
|
@@ -7,7 +7,7 @@ var STRICT_METHOD = arrayMethodIsStrict('forEach');
|
|
|
7
7
|
var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
|
|
8
8
|
|
|
9
9
|
// `Array.prototype.forEach` method implementation
|
|
10
|
-
// https://tc39.
|
|
10
|
+
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
11
11
|
module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
|
|
12
12
|
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
13
13
|
} : [].forEach;
|
package/internals/array-from.js
CHANGED
|
@@ -8,7 +8,7 @@ var createProperty = require('../internals/create-property');
|
|
|
8
8
|
var getIteratorMethod = require('../internals/get-iterator-method');
|
|
9
9
|
|
|
10
10
|
// `Array.from` method implementation
|
|
11
|
-
// https://tc39.
|
|
11
|
+
// https://tc39.es/ecma262/#sec-array.from
|
|
12
12
|
module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
|
13
13
|
var O = toObject(arrayLike);
|
|
14
14
|
var C = typeof this == 'function' ? this : Array;
|
|
@@ -24,9 +24,9 @@ var createMethod = function (IS_INCLUDES) {
|
|
|
24
24
|
|
|
25
25
|
module.exports = {
|
|
26
26
|
// `Array.prototype.includes` method
|
|
27
|
-
// https://tc39.
|
|
27
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
28
28
|
includes: createMethod(true),
|
|
29
29
|
// `Array.prototype.indexOf` method
|
|
30
|
-
// https://tc39.
|
|
30
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
31
31
|
indexOf: createMethod(false)
|
|
32
32
|
};
|
|
@@ -6,13 +6,14 @@ var arraySpeciesCreate = require('../internals/array-species-create');
|
|
|
6
6
|
|
|
7
7
|
var push = [].push;
|
|
8
8
|
|
|
9
|
-
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
|
|
9
|
+
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterOut }` methods implementation
|
|
10
10
|
var createMethod = function (TYPE) {
|
|
11
11
|
var IS_MAP = TYPE == 1;
|
|
12
12
|
var IS_FILTER = TYPE == 2;
|
|
13
13
|
var IS_SOME = TYPE == 3;
|
|
14
14
|
var IS_EVERY = TYPE == 4;
|
|
15
15
|
var IS_FIND_INDEX = TYPE == 6;
|
|
16
|
+
var IS_FILTER_OUT = TYPE == 7;
|
|
16
17
|
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
|
17
18
|
return function ($this, callbackfn, that, specificCreate) {
|
|
18
19
|
var O = toObject($this);
|
|
@@ -21,7 +22,7 @@ var createMethod = function (TYPE) {
|
|
|
21
22
|
var length = toLength(self.length);
|
|
22
23
|
var index = 0;
|
|
23
24
|
var create = specificCreate || arraySpeciesCreate;
|
|
24
|
-
var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
|
25
|
+
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
|
|
25
26
|
var value, result;
|
|
26
27
|
for (;length > index; index++) if (NO_HOLES || index in self) {
|
|
27
28
|
value = self[index];
|
|
@@ -33,7 +34,10 @@ var createMethod = function (TYPE) {
|
|
|
33
34
|
case 5: return value; // find
|
|
34
35
|
case 6: return index; // findIndex
|
|
35
36
|
case 2: push.call(target, value); // filter
|
|
36
|
-
} else
|
|
37
|
+
} else switch (TYPE) {
|
|
38
|
+
case 4: return false; // every
|
|
39
|
+
case 7: push.call(target, value); // filterOut
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
|
@@ -42,24 +46,27 @@ var createMethod = function (TYPE) {
|
|
|
42
46
|
|
|
43
47
|
module.exports = {
|
|
44
48
|
// `Array.prototype.forEach` method
|
|
45
|
-
// https://tc39.
|
|
49
|
+
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
46
50
|
forEach: createMethod(0),
|
|
47
51
|
// `Array.prototype.map` method
|
|
48
|
-
// https://tc39.
|
|
52
|
+
// https://tc39.es/ecma262/#sec-array.prototype.map
|
|
49
53
|
map: createMethod(1),
|
|
50
54
|
// `Array.prototype.filter` method
|
|
51
|
-
// https://tc39.
|
|
55
|
+
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
52
56
|
filter: createMethod(2),
|
|
53
57
|
// `Array.prototype.some` method
|
|
54
|
-
// https://tc39.
|
|
58
|
+
// https://tc39.es/ecma262/#sec-array.prototype.some
|
|
55
59
|
some: createMethod(3),
|
|
56
60
|
// `Array.prototype.every` method
|
|
57
|
-
// https://tc39.
|
|
61
|
+
// https://tc39.es/ecma262/#sec-array.prototype.every
|
|
58
62
|
every: createMethod(4),
|
|
59
63
|
// `Array.prototype.find` method
|
|
60
|
-
// https://tc39.
|
|
64
|
+
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
61
65
|
find: createMethod(5),
|
|
62
66
|
// `Array.prototype.findIndex` method
|
|
63
|
-
// https://tc39.
|
|
64
|
-
findIndex: createMethod(6)
|
|
67
|
+
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
|
|
68
|
+
findIndex: createMethod(6),
|
|
69
|
+
// `Array.prototype.filterOut` method
|
|
70
|
+
// https://github.com/tc39/proposal-array-filtering
|
|
71
|
+
filterOut: createMethod(7)
|
|
65
72
|
};
|
|
@@ -14,7 +14,7 @@ var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0
|
|
|
14
14
|
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
|
|
15
15
|
|
|
16
16
|
// `Array.prototype.lastIndexOf` method implementation
|
|
17
|
-
// https://tc39.
|
|
17
|
+
// https://tc39.es/ecma262/#sec-array.prototype.lastindexof
|
|
18
18
|
module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
|
|
19
19
|
// convert -0 to +0
|
|
20
20
|
if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
|
|
@@ -32,9 +32,9 @@ var createMethod = function (IS_RIGHT) {
|
|
|
32
32
|
|
|
33
33
|
module.exports = {
|
|
34
34
|
// `Array.prototype.reduce` method
|
|
35
|
-
// https://tc39.
|
|
35
|
+
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
36
36
|
left: createMethod(false),
|
|
37
37
|
// `Array.prototype.reduceRight` method
|
|
38
|
-
// https://tc39.
|
|
38
|
+
// https://tc39.es/ecma262/#sec-array.prototype.reduceright
|
|
39
39
|
right: createMethod(true)
|
|
40
40
|
};
|
|
@@ -5,7 +5,7 @@ var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
5
5
|
var SPECIES = wellKnownSymbol('species');
|
|
6
6
|
|
|
7
7
|
// `ArraySpeciesCreate` abstract operation
|
|
8
|
-
// https://tc39.
|
|
8
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
|
9
9
|
module.exports = function (originalArray, length) {
|
|
10
10
|
var C;
|
|
11
11
|
if (isArray(originalArray)) {
|
package/internals/create-html.js
CHANGED
|
@@ -3,7 +3,7 @@ var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
|
3
3
|
var quot = /"/g;
|
|
4
4
|
|
|
5
5
|
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-createhtml
|
|
7
7
|
module.exports = function (string, tag, attribute, value) {
|
|
8
8
|
var S = String(requireObjectCoercible(string));
|
|
9
9
|
var p1 = '<' + tag;
|
|
@@ -8,7 +8,7 @@ var getTime = DatePrototype.getTime;
|
|
|
8
8
|
var nativeDateToISOString = DatePrototype.toISOString;
|
|
9
9
|
|
|
10
10
|
// `Date.prototype.toISOString` method implementation
|
|
11
|
-
// https://tc39.
|
|
11
|
+
// https://tc39.es/ecma262/#sec-date.prototype.toisostring
|
|
12
12
|
// PhantomJS / old WebKit fails here:
|
|
13
13
|
module.exports = (fails(function () {
|
|
14
14
|
return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
|
package/internals/descriptors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var fails = require('../internals/fails');
|
|
2
2
|
|
|
3
|
-
//
|
|
3
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
4
4
|
module.exports = !fails(function () {
|
|
5
5
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
6
6
|
});
|
|
@@ -14,7 +14,7 @@ var construct = function (C, argsLength, args) {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
// `Function.prototype.bind` method implementation
|
|
17
|
-
// https://tc39.
|
|
17
|
+
// https://tc39.es/ecma262/#sec-function.prototype.bind
|
|
18
18
|
module.exports = Function.bind || function bind(that /* , ...args */) {
|
|
19
19
|
var fn = aFunction(this);
|
|
20
20
|
var partArgs = slice.call(arguments, 1);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var toObject = require('../internals/to-object');
|
|
2
|
+
|
|
3
|
+
var floor = Math.floor;
|
|
4
|
+
var replace = ''.replace;
|
|
5
|
+
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
|
6
|
+
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
|
|
7
|
+
|
|
8
|
+
// https://tc39.es/ecma262/#sec-getsubstitution
|
|
9
|
+
module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
|
|
10
|
+
var tailPos = position + matched.length;
|
|
11
|
+
var m = captures.length;
|
|
12
|
+
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
|
13
|
+
if (namedCaptures !== undefined) {
|
|
14
|
+
namedCaptures = toObject(namedCaptures);
|
|
15
|
+
symbols = SUBSTITUTION_SYMBOLS;
|
|
16
|
+
}
|
|
17
|
+
return replace.call(replacement, symbols, function (match, ch) {
|
|
18
|
+
var capture;
|
|
19
|
+
switch (ch.charAt(0)) {
|
|
20
|
+
case '$': return '$';
|
|
21
|
+
case '&': return matched;
|
|
22
|
+
case '`': return str.slice(0, position);
|
|
23
|
+
case "'": return str.slice(tailPos);
|
|
24
|
+
case '<':
|
|
25
|
+
capture = namedCaptures[ch.slice(1, -1)];
|
|
26
|
+
break;
|
|
27
|
+
default: // \d\d?
|
|
28
|
+
var n = +ch;
|
|
29
|
+
if (n === 0) return match;
|
|
30
|
+
if (n > m) {
|
|
31
|
+
var f = floor(n / 10);
|
|
32
|
+
if (f === 0) return match;
|
|
33
|
+
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
|
34
|
+
return match;
|
|
35
|
+
}
|
|
36
|
+
capture = captures[n - 1];
|
|
37
|
+
}
|
|
38
|
+
return capture === undefined ? '' : capture;
|
|
39
|
+
});
|
|
40
|
+
};
|
package/internals/is-array.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var classof = require('../internals/classof-raw');
|
|
2
2
|
|
|
3
3
|
// `IsArray` abstract operation
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-isarray
|
|
5
5
|
module.exports = Array.isArray || function isArray(arg) {
|
|
6
6
|
return classof(arg) == 'Array';
|
|
7
7
|
};
|
package/internals/is-integer.js
CHANGED
|
@@ -3,7 +3,7 @@ var isObject = require('../internals/is-object');
|
|
|
3
3
|
var floor = Math.floor;
|
|
4
4
|
|
|
5
5
|
// `Number.isInteger` method implementation
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-number.isinteger
|
|
7
7
|
module.exports = function isInteger(it) {
|
|
8
8
|
return !isObject(it) && isFinite(it) && floor(it) === it;
|
|
9
9
|
};
|
package/internals/is-regexp.js
CHANGED
|
@@ -5,7 +5,7 @@ var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
5
5
|
var MATCH = wellKnownSymbol('match');
|
|
6
6
|
|
|
7
7
|
// `IsRegExp` abstract operation
|
|
8
|
-
// https://tc39.
|
|
8
|
+
// https://tc39.es/ecma262/#sec-isregexp
|
|
9
9
|
module.exports = function (it) {
|
|
10
10
|
var isRegExp;
|
|
11
11
|
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
var fails = require('../internals/fails');
|
|
2
3
|
var getPrototypeOf = require('../internals/object-get-prototype-of');
|
|
3
4
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
4
5
|
var has = require('../internals/has');
|
|
@@ -11,7 +12,7 @@ var BUGGY_SAFARI_ITERATORS = false;
|
|
|
11
12
|
var returnThis = function () { return this; };
|
|
12
13
|
|
|
13
14
|
// `%IteratorPrototype%` object
|
|
14
|
-
// https://tc39.
|
|
15
|
+
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
|
15
16
|
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
|
16
17
|
|
|
17
18
|
if ([].keys) {
|
|
@@ -24,10 +25,16 @@ if ([].keys) {
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
|
|
29
|
+
var test = {};
|
|
30
|
+
// FF44- legacy iterators case
|
|
31
|
+
return IteratorPrototype[ITERATOR].call(test) !== test;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
|
|
28
35
|
|
|
29
36
|
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
|
30
|
-
if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
|
|
37
|
+
if ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) {
|
|
31
38
|
createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
|
|
32
39
|
}
|
|
33
40
|
|
package/internals/math-expm1.js
CHANGED
|
@@ -2,7 +2,7 @@ var nativeExpm1 = Math.expm1;
|
|
|
2
2
|
var exp = Math.exp;
|
|
3
3
|
|
|
4
4
|
// `Math.expm1` method implementation
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-math.expm1
|
|
6
6
|
module.exports = (!nativeExpm1
|
|
7
7
|
// Old FF bug
|
|
8
8
|
|| nativeExpm1(10) > 22025.465794806719 || nativeExpm1(10) < 22025.4657948067165168
|
package/internals/math-fround.js
CHANGED
|
@@ -12,7 +12,7 @@ var roundTiesToEven = function (n) {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
// `Math.fround` method implementation
|
|
15
|
-
// https://tc39.
|
|
15
|
+
// https://tc39.es/ecma262/#sec-math.fround
|
|
16
16
|
module.exports = Math.fround || function fround(x) {
|
|
17
17
|
var $abs = abs(x);
|
|
18
18
|
var $sign = sign(x);
|
package/internals/math-log1p.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var log = Math.log;
|
|
2
2
|
|
|
3
3
|
// `Math.log1p` method implementation
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-math.log1p
|
|
5
5
|
module.exports = Math.log1p || function log1p(x) {
|
|
6
6
|
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
|
|
7
7
|
};
|