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/internals/math-sign.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// `Math.sign` method implementation
|
|
2
|
-
// https://tc39.
|
|
2
|
+
// https://tc39.es/ecma262/#sec-math.sign
|
|
3
3
|
module.exports = Math.sign || function sign(x) {
|
|
4
4
|
// eslint-disable-next-line no-self-compare
|
|
5
5
|
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
|
package/internals/microtask.js
CHANGED
|
@@ -2,6 +2,7 @@ var global = require('../internals/global');
|
|
|
2
2
|
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
|
|
3
3
|
var macrotask = require('../internals/task').set;
|
|
4
4
|
var IS_IOS = require('../internals/engine-is-ios');
|
|
5
|
+
var IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');
|
|
5
6
|
var IS_NODE = require('../internals/engine-is-node');
|
|
6
7
|
|
|
7
8
|
var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
|
|
@@ -34,7 +35,8 @@ if (!queueMicrotask) {
|
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
|
37
|
-
|
|
38
|
+
// also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
|
|
39
|
+
if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
|
|
38
40
|
toggle = true;
|
|
39
41
|
node = document.createTextNode('');
|
|
40
42
|
new MutationObserver(flush).observe(node, { characterData: true });
|
|
@@ -3,7 +3,7 @@ var global = require('../internals/global');
|
|
|
3
3
|
var globalIsFinite = global.isFinite;
|
|
4
4
|
|
|
5
5
|
// `Number.isFinite` method
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-number.isfinite
|
|
7
7
|
module.exports = Number.isFinite || function isFinite(it) {
|
|
8
8
|
return typeof it == 'number' && globalIsFinite(it);
|
|
9
9
|
};
|
|
@@ -6,7 +6,7 @@ var $parseFloat = global.parseFloat;
|
|
|
6
6
|
var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
|
|
7
7
|
|
|
8
8
|
// `parseFloat` method
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-parsefloat-string
|
|
10
10
|
module.exports = FORCED ? function parseFloat(string) {
|
|
11
11
|
var trimmedString = trim(String(string));
|
|
12
12
|
var result = $parseFloat(trimmedString);
|
|
@@ -7,7 +7,7 @@ var hex = /^[+-]?0[Xx]/;
|
|
|
7
7
|
var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
|
|
8
8
|
|
|
9
9
|
// `parseInt` method
|
|
10
|
-
// https://tc39.
|
|
10
|
+
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
11
11
|
module.exports = FORCED ? function parseInt(string, radix) {
|
|
12
12
|
var S = trim(String(string));
|
|
13
13
|
return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
|
|
@@ -11,7 +11,7 @@ var nativeAssign = Object.assign;
|
|
|
11
11
|
var defineProperty = Object.defineProperty;
|
|
12
12
|
|
|
13
13
|
// `Object.assign` method
|
|
14
|
-
// https://tc39.
|
|
14
|
+
// https://tc39.es/ecma262/#sec-object.assign
|
|
15
15
|
module.exports = !nativeAssign || fails(function () {
|
|
16
16
|
// should have correct order of operations (Edge bug)
|
|
17
17
|
if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
|
|
@@ -64,7 +64,7 @@ var NullProtoObject = function () {
|
|
|
64
64
|
hiddenKeys[IE_PROTO] = true;
|
|
65
65
|
|
|
66
66
|
// `Object.create` method
|
|
67
|
-
// https://tc39.
|
|
67
|
+
// https://tc39.es/ecma262/#sec-object.create
|
|
68
68
|
module.exports = Object.create || function create(O, Properties) {
|
|
69
69
|
var result;
|
|
70
70
|
if (O !== null) {
|
|
@@ -4,7 +4,7 @@ var anObject = require('../internals/an-object');
|
|
|
4
4
|
var objectKeys = require('../internals/object-keys');
|
|
5
5
|
|
|
6
6
|
// `Object.defineProperties` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-object.defineproperties
|
|
8
8
|
module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
9
9
|
anObject(O);
|
|
10
10
|
var keys = objectKeys(Properties);
|
|
@@ -6,7 +6,7 @@ var toPrimitive = require('../internals/to-primitive');
|
|
|
6
6
|
var nativeDefineProperty = Object.defineProperty;
|
|
7
7
|
|
|
8
8
|
// `Object.defineProperty` method
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
10
10
|
exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
|
11
11
|
anObject(O);
|
|
12
12
|
P = toPrimitive(P, true);
|
|
@@ -9,7 +9,7 @@ var IE8_DOM_DEFINE = require('../internals/ie8-dom-define');
|
|
|
9
9
|
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
10
10
|
|
|
11
11
|
// `Object.getOwnPropertyDescriptor` method
|
|
12
|
-
// https://tc39.
|
|
12
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
13
13
|
exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
14
14
|
O = toIndexedObject(O);
|
|
15
15
|
P = toPrimitive(P, true);
|
|
@@ -4,7 +4,7 @@ var enumBugKeys = require('../internals/enum-bug-keys');
|
|
|
4
4
|
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
5
5
|
|
|
6
6
|
// `Object.getOwnPropertyNames` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
8
8
|
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
9
9
|
return internalObjectKeys(O, hiddenKeys);
|
|
10
10
|
};
|
|
@@ -7,7 +7,7 @@ var IE_PROTO = sharedKey('IE_PROTO');
|
|
|
7
7
|
var ObjectPrototype = Object.prototype;
|
|
8
8
|
|
|
9
9
|
// `Object.getPrototypeOf` method
|
|
10
|
-
// https://tc39.
|
|
10
|
+
// https://tc39.es/ecma262/#sec-object.getprototypeof
|
|
11
11
|
module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
|
|
12
12
|
O = toObject(O);
|
|
13
13
|
if (has(O, IE_PROTO)) return O[IE_PROTO];
|
package/internals/object-keys.js
CHANGED
|
@@ -2,7 +2,7 @@ var internalObjectKeys = require('../internals/object-keys-internal');
|
|
|
2
2
|
var enumBugKeys = require('../internals/enum-bug-keys');
|
|
3
3
|
|
|
4
4
|
// `Object.keys` method
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
6
6
|
module.exports = Object.keys || function keys(O) {
|
|
7
7
|
return internalObjectKeys(O, enumBugKeys);
|
|
8
8
|
};
|
|
@@ -6,7 +6,7 @@ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
|
7
7
|
|
|
8
8
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
9
|
-
// https://tc39.
|
|
9
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
10
10
|
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
11
11
|
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
12
12
|
return !!descriptor && descriptor.enumerable;
|
|
@@ -2,7 +2,7 @@ var anObject = require('../internals/an-object');
|
|
|
2
2
|
var aPossiblePrototype = require('../internals/a-possible-prototype');
|
|
3
3
|
|
|
4
4
|
// `Object.setPrototypeOf` method
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
6
6
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
7
7
|
/* eslint-disable no-proto */
|
|
8
8
|
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
@@ -24,9 +24,9 @@ var createMethod = function (TO_ENTRIES) {
|
|
|
24
24
|
|
|
25
25
|
module.exports = {
|
|
26
26
|
// `Object.entries` method
|
|
27
|
-
// https://tc39.
|
|
27
|
+
// https://tc39.es/ecma262/#sec-object.entries
|
|
28
28
|
entries: createMethod(true),
|
|
29
29
|
// `Object.values` method
|
|
30
|
-
// https://tc39.
|
|
30
|
+
// https://tc39.es/ecma262/#sec-object.values
|
|
31
31
|
values: createMethod(false)
|
|
32
32
|
};
|
|
@@ -3,7 +3,7 @@ var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');
|
|
|
3
3
|
var classof = require('../internals/classof');
|
|
4
4
|
|
|
5
5
|
// `Object.prototype.toString` method implementation
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
7
7
|
module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
|
|
8
8
|
return '[object ' + classof(this) + ']';
|
|
9
9
|
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var InternalStateModule = require('../internals/internal-state');
|
|
3
|
+
var createIteratorConstructor = require('../internals/create-iterator-constructor');
|
|
4
|
+
var isObject = require('../internals/is-object');
|
|
5
|
+
var defineProperties = require('../internals/object-define-properties');
|
|
6
|
+
var DESCRIPTORS = require('../internals/descriptors');
|
|
7
|
+
|
|
8
|
+
var INCORRECT_RANGE = 'Incorrect Number.range arguments';
|
|
9
|
+
var RANGE_ITERATOR = 'RangeIterator';
|
|
10
|
+
|
|
11
|
+
var setInternalState = InternalStateModule.set;
|
|
12
|
+
var getInternalState = InternalStateModule.getterFor(RANGE_ITERATOR);
|
|
13
|
+
|
|
14
|
+
var $RangeIterator = createIteratorConstructor(function RangeIterator(start, end, option, type, zero, one) {
|
|
15
|
+
if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) {
|
|
16
|
+
throw new TypeError(INCORRECT_RANGE);
|
|
17
|
+
}
|
|
18
|
+
if (start === Infinity || start === -Infinity) {
|
|
19
|
+
throw new RangeError(INCORRECT_RANGE);
|
|
20
|
+
}
|
|
21
|
+
var ifIncrease = end > start;
|
|
22
|
+
var inclusiveEnd = false;
|
|
23
|
+
var step;
|
|
24
|
+
if (option === undefined) {
|
|
25
|
+
step = undefined;
|
|
26
|
+
} else if (isObject(option)) {
|
|
27
|
+
step = option.step;
|
|
28
|
+
inclusiveEnd = !!option.inclusive;
|
|
29
|
+
} else if (typeof option == type) {
|
|
30
|
+
step = option;
|
|
31
|
+
} else {
|
|
32
|
+
throw new TypeError(INCORRECT_RANGE);
|
|
33
|
+
}
|
|
34
|
+
if (step == null) {
|
|
35
|
+
step = ifIncrease ? one : -one;
|
|
36
|
+
}
|
|
37
|
+
if (typeof step != type) {
|
|
38
|
+
throw new TypeError(INCORRECT_RANGE);
|
|
39
|
+
}
|
|
40
|
+
if (step === Infinity || step === -Infinity || (step === zero && start !== end)) {
|
|
41
|
+
throw new RangeError(INCORRECT_RANGE);
|
|
42
|
+
}
|
|
43
|
+
// eslint-disable-next-line no-self-compare
|
|
44
|
+
var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero);
|
|
45
|
+
setInternalState(this, {
|
|
46
|
+
type: RANGE_ITERATOR,
|
|
47
|
+
start: start,
|
|
48
|
+
end: end,
|
|
49
|
+
step: step,
|
|
50
|
+
inclusiveEnd: inclusiveEnd,
|
|
51
|
+
hitsEnd: hitsEnd,
|
|
52
|
+
currentCount: zero,
|
|
53
|
+
zero: zero
|
|
54
|
+
});
|
|
55
|
+
if (!DESCRIPTORS) {
|
|
56
|
+
this.start = start;
|
|
57
|
+
this.end = end;
|
|
58
|
+
this.step = step;
|
|
59
|
+
this.inclusive = inclusiveEnd;
|
|
60
|
+
}
|
|
61
|
+
}, RANGE_ITERATOR, function next() {
|
|
62
|
+
var state = getInternalState(this);
|
|
63
|
+
if (state.hitsEnd) return { value: undefined, done: true };
|
|
64
|
+
var start = state.start;
|
|
65
|
+
var end = state.end;
|
|
66
|
+
var step = state.step;
|
|
67
|
+
var currentYieldingValue = start + (step * state.currentCount++);
|
|
68
|
+
if (currentYieldingValue === end) state.hitsEnd = true;
|
|
69
|
+
var inclusiveEnd = state.inclusiveEnd;
|
|
70
|
+
var endCondition;
|
|
71
|
+
if (end > start) {
|
|
72
|
+
endCondition = inclusiveEnd ? currentYieldingValue > end : currentYieldingValue >= end;
|
|
73
|
+
} else {
|
|
74
|
+
endCondition = inclusiveEnd ? end > currentYieldingValue : end >= currentYieldingValue;
|
|
75
|
+
}
|
|
76
|
+
if (endCondition) {
|
|
77
|
+
return { value: undefined, done: state.hitsEnd = true };
|
|
78
|
+
} return { value: currentYieldingValue, done: false };
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
var getter = function (fn) {
|
|
82
|
+
return { get: fn, set: function () { /* empty */ }, configurable: true, enumerable: false };
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
if (DESCRIPTORS) {
|
|
86
|
+
defineProperties($RangeIterator.prototype, {
|
|
87
|
+
start: getter(function () {
|
|
88
|
+
return getInternalState(this).start;
|
|
89
|
+
}),
|
|
90
|
+
end: getter(function () {
|
|
91
|
+
return getInternalState(this).end;
|
|
92
|
+
}),
|
|
93
|
+
inclusive: getter(function () {
|
|
94
|
+
return getInternalState(this).inclusiveEnd;
|
|
95
|
+
}),
|
|
96
|
+
step: getter(function () {
|
|
97
|
+
return getInternalState(this).step;
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = $RangeIterator;
|
|
@@ -2,7 +2,7 @@ var classof = require('./classof-raw');
|
|
|
2
2
|
var regexpExec = require('./regexp-exec');
|
|
3
3
|
|
|
4
4
|
// `RegExpExec` abstract operation
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-regexpexec
|
|
6
6
|
module.exports = function (R, S) {
|
|
7
7
|
var exec = R.exec;
|
|
8
8
|
if (typeof exec === 'function') {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var anObject = require('../internals/an-object');
|
|
3
3
|
|
|
4
4
|
// `RegExp.prototype.flags` getter implementation
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
6
6
|
module.exports = function () {
|
|
7
7
|
var that = anObject(this);
|
|
8
8
|
var result = '';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// `RequireObjectCoercible` abstract operation
|
|
2
|
-
// https://tc39.
|
|
2
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
3
3
|
module.exports = function (it) {
|
|
4
4
|
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
5
5
|
return it;
|
package/internals/same-value.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// `SameValue` abstract operation
|
|
2
|
-
// https://tc39.
|
|
2
|
+
// https://tc39.es/ecma262/#sec-samevalue
|
|
3
3
|
module.exports = Object.is || function is(x, y) {
|
|
4
4
|
// eslint-disable-next-line no-self-compare
|
|
5
5
|
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
package/internals/shared.js
CHANGED
|
@@ -4,7 +4,7 @@ var store = require('../internals/shared-store');
|
|
|
4
4
|
(module.exports = function (key, value) {
|
|
5
5
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
6
6
|
})('versions', []).push({
|
|
7
|
-
version: '3.
|
|
7
|
+
version: '3.8.3',
|
|
8
8
|
mode: IS_PURE ? 'pure' : 'global',
|
|
9
|
-
copyright: '©
|
|
9
|
+
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
|
10
10
|
});
|
|
@@ -5,7 +5,7 @@ var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
5
5
|
var SPECIES = wellKnownSymbol('species');
|
|
6
6
|
|
|
7
7
|
// `SpeciesConstructor` abstract operation
|
|
8
|
-
// https://tc39.
|
|
8
|
+
// https://tc39.es/ecma262/#sec-speciesconstructor
|
|
9
9
|
module.exports = function (O, defaultConstructor) {
|
|
10
10
|
var C = anObject(O).constructor;
|
|
11
11
|
var S;
|
|
@@ -19,7 +19,7 @@ var createMethod = function (CONVERT_TO_STRING) {
|
|
|
19
19
|
|
|
20
20
|
module.exports = {
|
|
21
21
|
// `String.prototype.codePointAt` method
|
|
22
|
-
// https://tc39.
|
|
22
|
+
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
23
23
|
codeAt: createMethod(false),
|
|
24
24
|
// `String.prototype.at` method
|
|
25
25
|
// https://github.com/mathiasbynens/String.prototype.at
|
package/internals/string-pad.js
CHANGED
|
@@ -23,9 +23,9 @@ var createMethod = function (IS_END) {
|
|
|
23
23
|
|
|
24
24
|
module.exports = {
|
|
25
25
|
// `String.prototype.padStart` method
|
|
26
|
-
// https://tc39.
|
|
26
|
+
// https://tc39.es/ecma262/#sec-string.prototype.padstart
|
|
27
27
|
start: createMethod(false),
|
|
28
28
|
// `String.prototype.padEnd` method
|
|
29
|
-
// https://tc39.
|
|
29
|
+
// https://tc39.es/ecma262/#sec-string.prototype.padend
|
|
30
30
|
end: createMethod(true)
|
|
31
31
|
};
|
|
@@ -3,7 +3,7 @@ var toInteger = require('../internals/to-integer');
|
|
|
3
3
|
var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
4
4
|
|
|
5
5
|
// `String.prototype.repeat` method implementation
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-string.prototype.repeat
|
|
7
7
|
module.exports = ''.repeat || function repeat(count) {
|
|
8
8
|
var str = String(requireObjectCoercible(this));
|
|
9
9
|
var result = '';
|
package/internals/string-trim.js
CHANGED
|
@@ -17,12 +17,12 @@ var createMethod = function (TYPE) {
|
|
|
17
17
|
|
|
18
18
|
module.exports = {
|
|
19
19
|
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
20
|
-
// https://tc39.
|
|
20
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
21
21
|
start: createMethod(1),
|
|
22
22
|
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
23
|
-
// https://tc39.
|
|
23
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
24
24
|
end: createMethod(2),
|
|
25
25
|
// `String.prototype.trim` method
|
|
26
|
-
// https://tc39.
|
|
26
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
27
27
|
trim: createMethod(3)
|
|
28
28
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var classof = require('../internals/classof-raw');
|
|
2
2
|
|
|
3
3
|
// `thisNumberValue` abstract operation
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-thisnumbervalue
|
|
5
5
|
module.exports = function (value) {
|
|
6
6
|
if (typeof value != 'number' && classof(value) != 'Number') {
|
|
7
7
|
throw TypeError('Incorrect invocation');
|
package/internals/to-index.js
CHANGED
|
@@ -2,7 +2,7 @@ var toInteger = require('../internals/to-integer');
|
|
|
2
2
|
var toLength = require('../internals/to-length');
|
|
3
3
|
|
|
4
4
|
// `ToIndex` abstract operation
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-toindex
|
|
6
6
|
module.exports = function (it) {
|
|
7
7
|
if (it === undefined) return 0;
|
|
8
8
|
var number = toInteger(it);
|
package/internals/to-integer.js
CHANGED
|
@@ -2,7 +2,7 @@ var ceil = Math.ceil;
|
|
|
2
2
|
var floor = Math.floor;
|
|
3
3
|
|
|
4
4
|
// `ToInteger` abstract operation
|
|
5
|
-
// https://tc39.
|
|
5
|
+
// https://tc39.es/ecma262/#sec-tointeger
|
|
6
6
|
module.exports = function (argument) {
|
|
7
7
|
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
|
8
8
|
};
|
package/internals/to-length.js
CHANGED
|
@@ -3,7 +3,7 @@ var toInteger = require('../internals/to-integer');
|
|
|
3
3
|
var min = Math.min;
|
|
4
4
|
|
|
5
5
|
// `ToLength` abstract operation
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
7
7
|
module.exports = function (argument) {
|
|
8
8
|
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
9
9
|
};
|
package/internals/to-object.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
2
2
|
|
|
3
3
|
// `ToObject` abstract operation
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
5
5
|
module.exports = function (argument) {
|
|
6
6
|
return Object(requireObjectCoercible(argument));
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var isObject = require('../internals/is-object');
|
|
2
2
|
|
|
3
3
|
// `ToPrimitive` abstract operation
|
|
4
|
-
// https://tc39.
|
|
4
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
5
5
|
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
|
6
6
|
// and the second argument - flag - preferred type is a string
|
|
7
7
|
module.exports = function (input, PREFERRED_STRING) {
|
|
@@ -11,6 +11,7 @@ var $AggregateError = function AggregateError(errors, message) {
|
|
|
11
11
|
var that = this;
|
|
12
12
|
if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);
|
|
13
13
|
if (setPrototypeOf) {
|
|
14
|
+
// eslint-disable-next-line unicorn/error-message
|
|
14
15
|
that = setPrototypeOf(new Error(undefined), getPrototypeOf(that));
|
|
15
16
|
}
|
|
16
17
|
if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));
|
|
@@ -26,6 +27,8 @@ $AggregateError.prototype = create(Error.prototype, {
|
|
|
26
27
|
name: createPropertyDescriptor(5, 'AggregateError')
|
|
27
28
|
});
|
|
28
29
|
|
|
30
|
+
// `AggregateError` constructor
|
|
31
|
+
// https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
|
29
32
|
$({ global: true }, {
|
|
30
33
|
AggregateError: $AggregateError
|
|
31
34
|
});
|
|
@@ -9,7 +9,7 @@ var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER];
|
|
|
9
9
|
var NativeArrayBuffer = global[ARRAY_BUFFER];
|
|
10
10
|
|
|
11
11
|
// `ArrayBuffer` constructor
|
|
12
|
-
// https://tc39.
|
|
12
|
+
// https://tc39.es/ecma262/#sec-arraybuffer-constructor
|
|
13
13
|
$({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, {
|
|
14
14
|
ArrayBuffer: ArrayBuffer
|
|
15
15
|
});
|
|
@@ -4,7 +4,7 @@ var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
|
|
|
4
4
|
var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
|
|
5
5
|
|
|
6
6
|
// `ArrayBuffer.isView` method
|
|
7
|
-
// https://tc39.
|
|
7
|
+
// https://tc39.es/ecma262/#sec-arraybuffer.isview
|
|
8
8
|
$({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
|
|
9
9
|
isView: ArrayBufferViewCore.isView
|
|
10
10
|
});
|
|
@@ -16,7 +16,7 @@ var INCORRECT_SLICE = fails(function () {
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
// `ArrayBuffer.prototype.slice` method
|
|
19
|
-
// https://tc39.
|
|
19
|
+
// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice
|
|
20
20
|
$({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
|
|
21
21
|
slice: function slice(start, end) {
|
|
22
22
|
if (nativeArrayBufferSlice !== undefined && end === undefined) {
|
|
@@ -35,7 +35,7 @@ var isConcatSpreadable = function (O) {
|
|
|
35
35
|
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
|
36
36
|
|
|
37
37
|
// `Array.prototype.concat` method
|
|
38
|
-
// https://tc39.
|
|
38
|
+
// https://tc39.es/ecma262/#sec-array.prototype.concat
|
|
39
39
|
// with adding support of @@isConcatSpreadable and @@species
|
|
40
40
|
$({ target: 'Array', proto: true, forced: FORCED }, {
|
|
41
41
|
concat: function concat(arg) { // eslint-disable-line no-unused-vars
|
|
@@ -3,10 +3,10 @@ var copyWithin = require('../internals/array-copy-within');
|
|
|
3
3
|
var addToUnscopables = require('../internals/add-to-unscopables');
|
|
4
4
|
|
|
5
5
|
// `Array.prototype.copyWithin` method
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-array.prototype.copywithin
|
|
7
7
|
$({ target: 'Array', proto: true }, {
|
|
8
8
|
copyWithin: copyWithin
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
// https://tc39.
|
|
11
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
12
12
|
addToUnscopables('copyWithin');
|
|
@@ -8,7 +8,7 @@ var STRICT_METHOD = arrayMethodIsStrict('every');
|
|
|
8
8
|
var USES_TO_LENGTH = arrayMethodUsesToLength('every');
|
|
9
9
|
|
|
10
10
|
// `Array.prototype.every` method
|
|
11
|
-
// https://tc39.
|
|
11
|
+
// https://tc39.es/ecma262/#sec-array.prototype.every
|
|
12
12
|
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
|
|
13
13
|
every: function every(callbackfn /* , thisArg */) {
|
|
14
14
|
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
package/modules/es.array.fill.js
CHANGED
|
@@ -3,10 +3,10 @@ var fill = require('../internals/array-fill');
|
|
|
3
3
|
var addToUnscopables = require('../internals/add-to-unscopables');
|
|
4
4
|
|
|
5
5
|
// `Array.prototype.fill` method
|
|
6
|
-
// https://tc39.
|
|
6
|
+
// https://tc39.es/ecma262/#sec-array.prototype.fill
|
|
7
7
|
$({ target: 'Array', proto: true }, {
|
|
8
8
|
fill: fill
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
// https://tc39.
|
|
11
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
12
12
|
addToUnscopables('fill');
|
|
@@ -9,7 +9,7 @@ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
|
|
9
9
|
var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
|
|
10
10
|
|
|
11
11
|
// `Array.prototype.filter` method
|
|
12
|
-
// https://tc39.
|
|
12
|
+
// https://tc39.es/ecma262/#sec-array.prototype.filter
|
|
13
13
|
// with adding support of @@species
|
|
14
14
|
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
|
|
15
15
|
filter: function filter(callbackfn /* , thisArg */) {
|
|
@@ -13,12 +13,12 @@ var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX);
|
|
|
13
13
|
if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
|
|
14
14
|
|
|
15
15
|
// `Array.prototype.findIndex` method
|
|
16
|
-
// https://tc39.
|
|
16
|
+
// https://tc39.es/ecma262/#sec-array.prototype.findindex
|
|
17
17
|
$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
|
|
18
18
|
findIndex: function findIndex(callbackfn /* , that = undefined */) {
|
|
19
19
|
return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
// https://tc39.
|
|
23
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
24
24
|
addToUnscopables(FIND_INDEX);
|
package/modules/es.array.find.js
CHANGED
|
@@ -13,12 +13,12 @@ var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
|
|
|
13
13
|
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
|
14
14
|
|
|
15
15
|
// `Array.prototype.find` method
|
|
16
|
-
// https://tc39.
|
|
16
|
+
// https://tc39.es/ecma262/#sec-array.prototype.find
|
|
17
17
|
$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
|
|
18
18
|
find: function find(callbackfn /* , that = undefined */) {
|
|
19
19
|
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
// https://tc39.
|
|
23
|
+
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
|
24
24
|
addToUnscopables(FIND);
|
|
@@ -7,7 +7,7 @@ var aFunction = require('../internals/a-function');
|
|
|
7
7
|
var arraySpeciesCreate = require('../internals/array-species-create');
|
|
8
8
|
|
|
9
9
|
// `Array.prototype.flatMap` method
|
|
10
|
-
// https://
|
|
10
|
+
// https://tc39.es/ecma262/#sec-array.prototype.flatmap
|
|
11
11
|
$({ target: 'Array', proto: true }, {
|
|
12
12
|
flatMap: function flatMap(callbackfn /* , thisArg */) {
|
|
13
13
|
var O = toObject(this);
|
package/modules/es.array.flat.js
CHANGED
|
@@ -7,7 +7,7 @@ var toInteger = require('../internals/to-integer');
|
|
|
7
7
|
var arraySpeciesCreate = require('../internals/array-species-create');
|
|
8
8
|
|
|
9
9
|
// `Array.prototype.flat` method
|
|
10
|
-
// https://
|
|
10
|
+
// https://tc39.es/ecma262/#sec-array.prototype.flat
|
|
11
11
|
$({ target: 'Array', proto: true }, {
|
|
12
12
|
flat: function flat(/* depthArg = 1 */) {
|
|
13
13
|
var depthArg = arguments.length ? arguments[0] : undefined;
|