core-js 3.23.5 → 3.25.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.
Files changed (158) hide show
  1. package/README.md +1 -1
  2. package/actual/object/proto.js +3 -0
  3. package/actual/typed-array/index.js +1 -0
  4. package/actual/typed-array/methods.js +1 -0
  5. package/actual/typed-array/to-spliced.js +1 -0
  6. package/es/index.js +1 -0
  7. package/es/object/index.js +1 -0
  8. package/es/object/proto.js +1 -0
  9. package/features/async-iterator/indexed.js +1 -0
  10. package/features/iterator/indexed.js +1 -0
  11. package/features/object/proto.js +1 -0
  12. package/full/async-iterator/index.js +2 -0
  13. package/full/async-iterator/indexed.js +8 -0
  14. package/full/index.js +3 -0
  15. package/full/iterator/index.js +2 -0
  16. package/full/iterator/indexed.js +8 -0
  17. package/full/object/proto.js +3 -0
  18. package/full/typed-array/to-spliced.js +1 -0
  19. package/internals/{array-buffer-native.js → array-buffer-basic-detection.js} +0 -0
  20. package/internals/array-buffer-view-core.js +1 -1
  21. package/internals/array-buffer.js +3 -3
  22. package/internals/array-set-length.js +27 -0
  23. package/internals/array-unique-by.js +2 -1
  24. package/internals/async-from-sync-iterator.js +7 -19
  25. package/internals/async-iterator-close.js +18 -0
  26. package/internals/async-iterator-create-proxy.js +103 -44
  27. package/internals/async-iterator-indexed.js +28 -0
  28. package/internals/async-iterator-iteration.js +30 -39
  29. package/internals/async-iterator-wrap.js +6 -0
  30. package/internals/collection-from.js +2 -1
  31. package/internals/collection-strong.js +3 -2
  32. package/internals/collection-weak.js +3 -2
  33. package/internals/collection.js +2 -1
  34. package/internals/date-to-iso-string.js +7 -6
  35. package/internals/engine-is-browser.js +6 -1
  36. package/internals/{clear-error-stack.js → error-stack-clear.js} +0 -0
  37. package/internals/get-iterator-method.js +2 -1
  38. package/internals/get-method.js +2 -1
  39. package/internals/internal-state.js +3 -3
  40. package/internals/is-iterable.js +2 -0
  41. package/internals/is-null-or-undefined.js +5 -0
  42. package/internals/is-object.js +8 -1
  43. package/internals/{create-iterator-constructor.js → iterator-create-constructor.js} +0 -0
  44. package/internals/iterator-create-proxy.js +56 -32
  45. package/internals/{define-iterator.js → iterator-define.js} +1 -1
  46. package/internals/iterator-indexed.js +18 -0
  47. package/internals/iterators-core.js +2 -1
  48. package/internals/new-promise-capability.js +3 -1
  49. package/internals/not-a-nan.js +7 -0
  50. package/internals/number-parse-float.js +5 -5
  51. package/internals/numeric-range-iterator.js +8 -7
  52. package/internals/object-iterator.js +1 -1
  53. package/internals/promise-constructor-detection.js +12 -11
  54. package/internals/require-object-coercible.js +3 -1
  55. package/internals/shared.js +2 -2
  56. package/internals/species-constructor.js +2 -1
  57. package/internals/{native-symbol.js → symbol-constructor-detection.js} +0 -0
  58. package/internals/{native-symbol-registry.js → symbol-registry-detection.js} +1 -1
  59. package/internals/{native-url.js → url-constructor-detection.js} +0 -0
  60. package/internals/use-symbol-as-uid.js +1 -1
  61. package/internals/weak-map-basic-detection.js +6 -0
  62. package/internals/{define-well-known-symbol.js → well-known-symbol-define.js} +0 -0
  63. package/internals/well-known-symbol.js +1 -1
  64. package/internals/wrap-error-constructor-with-cause.js +1 -1
  65. package/modules/es.aggregate-error.cause.js +1 -0
  66. package/modules/es.aggregate-error.constructor.js +2 -2
  67. package/modules/es.array-buffer.slice.js +3 -3
  68. package/modules/es.array.index-of.js +5 -5
  69. package/modules/es.array.iterator.js +1 -1
  70. package/modules/es.array.join.js +2 -2
  71. package/modules/es.array.push.js +2 -1
  72. package/modules/es.array.reverse.js +2 -2
  73. package/modules/es.array.slice.js +2 -2
  74. package/modules/es.array.sort.js +3 -3
  75. package/modules/es.array.splice.js +2 -1
  76. package/modules/es.array.unshift.js +2 -1
  77. package/modules/es.data-view.constructor.js +1 -1
  78. package/modules/es.date.now.js +2 -2
  79. package/modules/es.date.set-year.js +2 -2
  80. package/modules/es.date.to-string.js +4 -4
  81. package/modules/es.json.stringify.js +1 -1
  82. package/modules/es.number.to-exponential.js +11 -11
  83. package/modules/es.number.to-fixed.js +6 -6
  84. package/modules/es.number.to-precision.js +5 -5
  85. package/modules/es.object.get-own-property-symbols.js +1 -1
  86. package/modules/es.object.proto.js +29 -0
  87. package/modules/es.regexp.test.js +12 -12
  88. package/modules/es.regexp.to-string.js +3 -3
  89. package/modules/es.string.ends-with.js +3 -3
  90. package/modules/es.string.iterator.js +1 -1
  91. package/modules/es.string.match-all.js +8 -7
  92. package/modules/es.string.match.js +2 -1
  93. package/modules/es.string.replace-all.js +2 -1
  94. package/modules/es.string.replace.js +2 -1
  95. package/modules/es.string.search.js +2 -1
  96. package/modules/es.string.split.js +3 -2
  97. package/modules/es.string.starts-with.js +3 -3
  98. package/modules/es.symbol.async-iterator.js +1 -1
  99. package/modules/es.symbol.constructor.js +2 -2
  100. package/modules/es.symbol.description.js +4 -4
  101. package/modules/es.symbol.for.js +1 -1
  102. package/modules/es.symbol.has-instance.js +1 -1
  103. package/modules/es.symbol.is-concat-spreadable.js +1 -1
  104. package/modules/es.symbol.iterator.js +1 -1
  105. package/modules/es.symbol.key-for.js +1 -1
  106. package/modules/es.symbol.match-all.js +1 -1
  107. package/modules/es.symbol.match.js +1 -1
  108. package/modules/es.symbol.replace.js +1 -1
  109. package/modules/es.symbol.search.js +1 -1
  110. package/modules/es.symbol.species.js +1 -1
  111. package/modules/es.symbol.split.js +1 -1
  112. package/modules/es.symbol.to-primitive.js +1 -1
  113. package/modules/es.symbol.to-string-tag.js +1 -1
  114. package/modules/es.symbol.unscopables.js +1 -1
  115. package/modules/es.typed-array.sort.js +7 -7
  116. package/modules/es.weak-map.constructor.js +1 -1
  117. package/modules/esnext.array.is-template-object.js +1 -1
  118. package/modules/esnext.async-iterator.as-indexed-pairs.js +4 -24
  119. package/modules/esnext.async-iterator.drop.js +15 -11
  120. package/modules/esnext.async-iterator.filter.js +23 -10
  121. package/modules/esnext.async-iterator.flat-map.js +30 -16
  122. package/modules/esnext.async-iterator.from.js +3 -9
  123. package/modules/esnext.async-iterator.indexed.js +7 -0
  124. package/modules/esnext.async-iterator.map.js +28 -9
  125. package/modules/esnext.async-iterator.reduce.js +9 -4
  126. package/modules/esnext.async-iterator.take.js +23 -12
  127. package/modules/esnext.iterator.as-indexed-pairs.js +4 -17
  128. package/modules/esnext.iterator.drop.js +4 -4
  129. package/modules/esnext.iterator.filter.js +3 -3
  130. package/modules/esnext.iterator.flat-map.js +9 -11
  131. package/modules/esnext.iterator.from.js +3 -6
  132. package/modules/esnext.iterator.indexed.js +7 -0
  133. package/modules/esnext.iterator.map.js +3 -3
  134. package/modules/esnext.iterator.take.js +5 -4
  135. package/modules/esnext.iterator.to-async.js +3 -1
  136. package/modules/esnext.math.seeded-prng.js +1 -1
  137. package/modules/esnext.observable.constructor.js +4 -3
  138. package/modules/esnext.string.code-points.js +1 -1
  139. package/modules/esnext.symbol.async-dispose.js +1 -1
  140. package/modules/esnext.symbol.dispose.js +1 -1
  141. package/modules/esnext.symbol.matcher.js +1 -1
  142. package/modules/esnext.symbol.metadata-key.js +1 -1
  143. package/modules/esnext.symbol.metadata.js +1 -1
  144. package/modules/esnext.symbol.observable.js +1 -1
  145. package/modules/esnext.symbol.pattern-match.js +1 -1
  146. package/modules/esnext.symbol.replace-all.js +1 -1
  147. package/modules/esnext.typed-array.to-spliced.js +1 -0
  148. package/modules/web.dom-exception.constructor.js +1 -1
  149. package/modules/web.dom-exception.stack.js +1 -1
  150. package/modules/web.structured-clone.js +26 -14
  151. package/modules/web.url-search-params.constructor.js +2 -2
  152. package/modules/web.url.constructor.js +1 -1
  153. package/package.json +1 -1
  154. package/proposals/change-array-by-copy.js +1 -0
  155. package/proposals/iterator-helpers.js +4 -0
  156. package/stable/index.js +1 -0
  157. package/stable/object/proto.js +3 -0
  158. package/internals/native-weak-map.js +0 -7
@@ -4,8 +4,9 @@ var create = require('../internals/object-create');
4
4
  var defineBuiltIns = require('../internals/define-built-ins');
5
5
  var bind = require('../internals/function-bind-context');
6
6
  var anInstance = require('../internals/an-instance');
7
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
7
8
  var iterate = require('../internals/iterate');
8
- var defineIterator = require('../internals/define-iterator');
9
+ var defineIterator = require('../internals/iterator-define');
9
10
  var setSpecies = require('../internals/set-species');
10
11
  var DESCRIPTORS = require('../internals/descriptors');
11
12
  var fastKey = require('../internals/internal-metadata').fastKey;
@@ -26,7 +27,7 @@ module.exports = {
26
27
  size: 0
27
28
  });
28
29
  if (!DESCRIPTORS) that.size = 0;
29
- if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
30
+ if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
30
31
  });
31
32
 
32
33
  var Prototype = Constructor.prototype;
@@ -2,9 +2,10 @@
2
2
  var uncurryThis = require('../internals/function-uncurry-this');
3
3
  var defineBuiltIns = require('../internals/define-built-ins');
4
4
  var getWeakData = require('../internals/internal-metadata').getWeakData;
5
+ var anInstance = require('../internals/an-instance');
5
6
  var anObject = require('../internals/an-object');
7
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
6
8
  var isObject = require('../internals/is-object');
7
- var anInstance = require('../internals/an-instance');
8
9
  var iterate = require('../internals/iterate');
9
10
  var ArrayIterationModule = require('../internals/array-iteration');
10
11
  var hasOwn = require('../internals/has-own-property');
@@ -63,7 +64,7 @@ module.exports = {
63
64
  id: id++,
64
65
  frozen: undefined
65
66
  });
66
- if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
67
+ if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
67
68
  });
68
69
 
69
70
  var Prototype = Constructor.prototype;
@@ -8,6 +8,7 @@ var InternalMetadataModule = require('../internals/internal-metadata');
8
8
  var iterate = require('../internals/iterate');
9
9
  var anInstance = require('../internals/an-instance');
10
10
  var isCallable = require('../internals/is-callable');
11
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
11
12
  var isObject = require('../internals/is-object');
12
13
  var fails = require('../internals/fails');
13
14
  var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
@@ -75,7 +76,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
75
76
  Constructor = wrapper(function (dummy, iterable) {
76
77
  anInstance(dummy, NativePrototype);
77
78
  var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
78
- if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
79
+ if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
79
80
  return that;
80
81
  });
81
82
  Constructor.prototype = NativePrototype;
@@ -4,10 +4,11 @@ var fails = require('../internals/fails');
4
4
  var padStart = require('../internals/string-pad').start;
5
5
 
6
6
  var $RangeError = RangeError;
7
+ var $isFinite = isFinite;
7
8
  var abs = Math.abs;
8
9
  var DatePrototype = Date.prototype;
9
- var n$DateToISOString = DatePrototype.toISOString;
10
- var getTime = uncurryThis(DatePrototype.getTime);
10
+ var nativeDateToISOString = DatePrototype.toISOString;
11
+ var thisTimeValue = uncurryThis(DatePrototype.getTime);
11
12
  var getUTCDate = uncurryThis(DatePrototype.getUTCDate);
12
13
  var getUTCFullYear = uncurryThis(DatePrototype.getUTCFullYear);
13
14
  var getUTCHours = uncurryThis(DatePrototype.getUTCHours);
@@ -20,11 +21,11 @@ var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
20
21
  // https://tc39.es/ecma262/#sec-date.prototype.toisostring
21
22
  // PhantomJS / old WebKit fails here:
22
23
  module.exports = (fails(function () {
23
- return n$DateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
24
+ return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
24
25
  }) || !fails(function () {
25
- n$DateToISOString.call(new Date(NaN));
26
+ nativeDateToISOString.call(new Date(NaN));
26
27
  })) ? function toISOString() {
27
- if (!isFinite(getTime(this))) throw $RangeError('Invalid time value');
28
+ if (!$isFinite(thisTimeValue(this))) throw $RangeError('Invalid time value');
28
29
  var date = this;
29
30
  var year = getUTCFullYear(date);
30
31
  var milliseconds = getUTCMilliseconds(date);
@@ -37,4 +38,4 @@ module.exports = (fails(function () {
37
38
  ':' + padStart(getUTCSeconds(date), 2, 0) +
38
39
  '.' + padStart(milliseconds, 3, 0) +
39
40
  'Z';
40
- } : n$DateToISOString;
41
+ } : nativeDateToISOString;
@@ -1 +1,6 @@
1
- module.exports = typeof window == 'object' && typeof Deno != 'object';
1
+ var IS_DENO = require('../internals/engine-is-deno');
2
+ var IS_NODE = require('../internals/engine-is-node');
3
+
4
+ module.exports = !IS_DENO && !IS_NODE
5
+ && typeof window == 'object'
6
+ && typeof document == 'object';
@@ -1,12 +1,13 @@
1
1
  var classof = require('../internals/classof');
2
2
  var getMethod = require('../internals/get-method');
3
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
3
4
  var Iterators = require('../internals/iterators');
4
5
  var wellKnownSymbol = require('../internals/well-known-symbol');
5
6
 
6
7
  var ITERATOR = wellKnownSymbol('iterator');
7
8
 
8
9
  module.exports = function (it) {
9
- if (it != undefined) return getMethod(it, ITERATOR)
10
+ if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
10
11
  || getMethod(it, '@@iterator')
11
12
  || Iterators[classof(it)];
12
13
  };
@@ -1,8 +1,9 @@
1
1
  var aCallable = require('../internals/a-callable');
2
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
2
3
 
3
4
  // `GetMethod` abstract operation
4
5
  // https://tc39.es/ecma262/#sec-getmethod
5
6
  module.exports = function (V, P) {
6
7
  var func = V[P];
7
- return func == null ? undefined : aCallable(func);
8
+ return isNullOrUndefined(func) ? undefined : aCallable(func);
8
9
  };
@@ -1,4 +1,4 @@
1
- var NATIVE_WEAK_MAP = require('../internals/native-weak-map');
1
+ var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');
2
2
  var global = require('../internals/global');
3
3
  var uncurryThis = require('../internals/function-uncurry-this');
4
4
  var isObject = require('../internals/is-object');
@@ -32,7 +32,7 @@ if (NATIVE_WEAK_MAP || shared.state) {
32
32
  var wmhas = uncurryThis(store.has);
33
33
  var wmset = uncurryThis(store.set);
34
34
  set = function (it, metadata) {
35
- if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
35
+ if (wmhas(store, it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
36
36
  metadata.facade = it;
37
37
  wmset(store, it, metadata);
38
38
  return metadata;
@@ -47,7 +47,7 @@ if (NATIVE_WEAK_MAP || shared.state) {
47
47
  var STATE = sharedKey('state');
48
48
  hiddenKeys[STATE] = true;
49
49
  set = function (it, metadata) {
50
- if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
50
+ if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
51
51
  metadata.facade = it;
52
52
  createNonEnumerableProperty(it, STATE, metadata);
53
53
  return metadata;
@@ -1,5 +1,6 @@
1
1
  var classof = require('../internals/classof');
2
2
  var hasOwn = require('../internals/has-own-property');
3
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
3
4
  var wellKnownSymbol = require('../internals/well-known-symbol');
4
5
  var Iterators = require('../internals/iterators');
5
6
 
@@ -7,6 +8,7 @@ var ITERATOR = wellKnownSymbol('iterator');
7
8
  var $Object = Object;
8
9
 
9
10
  module.exports = function (it) {
11
+ if (isNullOrUndefined(it)) return false;
10
12
  var O = $Object(it);
11
13
  return O[ITERATOR] !== undefined
12
14
  || '@@iterator' in O
@@ -0,0 +1,5 @@
1
+ // we can't use just `it == null` since of `document.all` special case
2
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
3
+ module.exports = function (it) {
4
+ return it === null || it === undefined;
5
+ };
@@ -1,5 +1,12 @@
1
1
  var isCallable = require('../internals/is-callable');
2
2
 
3
- module.exports = function (it) {
3
+ var documentAll = typeof document == 'object' && document.all;
4
+
5
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
6
+ var SPECIAL_DOCUMENT_ALL = typeof documentAll == 'undefined' && documentAll !== undefined;
7
+
8
+ module.exports = SPECIAL_DOCUMENT_ALL ? function (it) {
9
+ return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
10
+ } : function (it) {
4
11
  return typeof it == 'object' ? it !== null : isCallable(it);
5
12
  };
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
  var call = require('../internals/function-call');
3
- var anObject = require('../internals/an-object');
4
3
  var create = require('../internals/object-create');
5
4
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
6
5
  var defineBuiltIns = require('../internals/define-built-ins');
@@ -8,53 +7,78 @@ var wellKnownSymbol = require('../internals/well-known-symbol');
8
7
  var InternalStateModule = require('../internals/internal-state');
9
8
  var getMethod = require('../internals/get-method');
10
9
  var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
10
+ var iteratorClose = require('../internals/iterator-close');
11
11
 
12
- var ITERATOR_PROXY = 'IteratorProxy';
12
+ var ITERATOR_HELPER = 'IteratorHelper';
13
+ var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
13
14
  var setInternalState = InternalStateModule.set;
14
- var getInternalState = InternalStateModule.getterFor(ITERATOR_PROXY);
15
15
 
16
16
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
17
17
 
18
- module.exports = function (nextHandler, IS_ITERATOR) {
19
- var IteratorProxy = function Iterator(record, state) {
20
- if (state) {
21
- state.iterator = record.iterator;
22
- state.next = record.next;
23
- } else state = record;
24
- state.type = ITERATOR_PROXY;
25
- state.done = false;
26
- state.ignoreArg = !IS_ITERATOR;
27
- setInternalState(this, state);
28
- };
18
+ var createIteratorProxyPrototype = function (IS_ITERATOR) {
19
+ var ITERATOR_PROXY = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
29
20
 
30
- IteratorProxy.prototype = defineBuiltIns(create(IteratorPrototype), {
31
- next: function next(arg) {
32
- var state = getInternalState(this);
33
- var args = arguments.length ? [state.ignoreArg ? undefined : arg] : IS_ITERATOR ? [] : [undefined];
34
- state.ignoreArg = false;
35
- var result = state.done ? undefined : call(nextHandler, state, args);
36
- return { done: state.done, value: result };
37
- },
38
- 'return': function (value) {
21
+ var getInternalState = InternalStateModule.getterFor(ITERATOR_PROXY);
22
+
23
+ var IteratorProxyPrototype = defineBuiltIns(create(IteratorPrototype), {
24
+ next: function next() {
39
25
  var state = getInternalState(this);
40
- var iterator = state.iterator;
41
- state.done = true;
42
- var $$return = getMethod(iterator, 'return');
43
- return { done: true, value: $$return ? anObject(call($$return, iterator, value)).value : value };
26
+ // for simplification:
27
+ // for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject`
28
+ // for `%IteratorHelperPrototype%.next` - just a value
29
+ if (IS_ITERATOR) return state.nextHandler();
30
+ try {
31
+ var result = state.done ? undefined : state.nextHandler();
32
+ return { value: result, done: state.done };
33
+ } catch (error) {
34
+ state.done = true;
35
+ throw error;
36
+ }
44
37
  },
45
- 'throw': function (value) {
38
+ 'return': function () {
46
39
  var state = getInternalState(this);
47
40
  var iterator = state.iterator;
48
41
  state.done = true;
49
- var $$throw = getMethod(iterator, 'throw');
50
- if ($$throw) return call($$throw, iterator, value);
51
- throw value;
42
+ if (IS_ITERATOR) {
43
+ var returnMethod = getMethod(iterator, 'return');
44
+ return returnMethod ? call(returnMethod, iterator) : { value: undefined, done: true };
45
+ }
46
+ var innerIterator = state.innerIterator;
47
+ if (innerIterator) try {
48
+ iteratorClose(innerIterator, 'return');
49
+ } catch (error) {
50
+ return iteratorClose(iterator, 'throw', error);
51
+ }
52
+ iteratorClose(iterator, 'return');
53
+ return { value: undefined, done: true };
52
54
  }
53
55
  });
54
56
 
55
57
  if (!IS_ITERATOR) {
56
- createNonEnumerableProperty(IteratorProxy.prototype, TO_STRING_TAG, 'Generator');
58
+ createNonEnumerableProperty(IteratorProxyPrototype, TO_STRING_TAG, 'Iterator Helper');
57
59
  }
58
60
 
61
+ return IteratorProxyPrototype;
62
+ };
63
+
64
+ var IteratorHelperPrototype = createIteratorProxyPrototype(false);
65
+ var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
66
+
67
+ module.exports = function (nextHandler, IS_ITERATOR) {
68
+ var ITERATOR_PROXY = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
69
+
70
+ var IteratorProxy = function Iterator(record, state) {
71
+ if (state) {
72
+ state.iterator = record.iterator;
73
+ state.next = record.next;
74
+ } else state = record;
75
+ state.type = ITERATOR_PROXY;
76
+ state.nextHandler = nextHandler;
77
+ state.done = false;
78
+ setInternalState(this, state);
79
+ };
80
+
81
+ IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
82
+
59
83
  return IteratorProxy;
60
84
  };
@@ -4,7 +4,7 @@ var call = require('../internals/function-call');
4
4
  var IS_PURE = require('../internals/is-pure');
5
5
  var FunctionName = require('../internals/function-name');
6
6
  var isCallable = require('../internals/is-callable');
7
- var createIteratorConstructor = require('../internals/create-iterator-constructor');
7
+ var createIteratorConstructor = require('../internals/iterator-create-constructor');
8
8
  var getPrototypeOf = require('../internals/object-get-prototype-of');
9
9
  var setPrototypeOf = require('../internals/object-set-prototype-of');
10
10
  var setToStringTag = require('../internals/set-to-string-tag');
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+ // https://github.com/tc39/proposal-iterator-helpers
3
+ var call = require('../internals/function-call');
4
+ var anObject = require('../internals/an-object');
5
+ var getIteratorDirect = require('../internals/get-iterator-direct');
6
+ var createIteratorProxy = require('../internals/iterator-create-proxy');
7
+
8
+ var IteratorProxy = createIteratorProxy(function () {
9
+ var result = anObject(call(this.next, this.iterator));
10
+ var done = this.done = !!result.done;
11
+ if (!done) return [this.index++, result.value];
12
+ });
13
+
14
+ module.exports = function indexed() {
15
+ return new IteratorProxy(getIteratorDirect(this), {
16
+ index: 0
17
+ });
18
+ };
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  var fails = require('../internals/fails');
3
3
  var isCallable = require('../internals/is-callable');
4
+ var isObject = require('../internals/is-object');
4
5
  var create = require('../internals/object-create');
5
6
  var getPrototypeOf = require('../internals/object-get-prototype-of');
6
7
  var defineBuiltIn = require('../internals/define-built-in');
@@ -25,7 +26,7 @@ if ([].keys) {
25
26
  }
26
27
  }
27
28
 
28
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
29
+ var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
29
30
  var test = {};
30
31
  // FF44- legacy iterators case
31
32
  return IteratorPrototype[ITERATOR].call(test) !== test;
@@ -1,10 +1,12 @@
1
1
  'use strict';
2
2
  var aCallable = require('../internals/a-callable');
3
3
 
4
+ var $TypeError = TypeError;
5
+
4
6
  var PromiseCapability = function (C) {
5
7
  var resolve, reject;
6
8
  this.promise = new C(function ($$resolve, $$reject) {
7
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
9
+ if (resolve !== undefined || reject !== undefined) throw $TypeError('Bad Promise constructor');
8
10
  resolve = $$resolve;
9
11
  reject = $$reject;
10
12
  });
@@ -0,0 +1,7 @@
1
+ var $RangeError = RangeError;
2
+
3
+ module.exports = function (it) {
4
+ // eslint-disable-next-line no-self-compare -- NaN check
5
+ if (it === it) return it;
6
+ throw $RangeError('NaN is not allowed');
7
+ };
@@ -6,17 +6,17 @@ var trim = require('../internals/string-trim').trim;
6
6
  var whitespaces = require('../internals/whitespaces');
7
7
 
8
8
  var charAt = uncurryThis(''.charAt);
9
- var n$ParseFloat = global.parseFloat;
9
+ var $parseFloat = global.parseFloat;
10
10
  var Symbol = global.Symbol;
11
11
  var ITERATOR = Symbol && Symbol.iterator;
12
- var FORCED = 1 / n$ParseFloat(whitespaces + '-0') !== -Infinity
12
+ var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
13
13
  // MS Edge 18- broken with boxed symbols
14
- || (ITERATOR && !fails(function () { n$ParseFloat(Object(ITERATOR)); }));
14
+ || (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); }));
15
15
 
16
16
  // `parseFloat` method
17
17
  // https://tc39.es/ecma262/#sec-parsefloat-string
18
18
  module.exports = FORCED ? function parseFloat(string) {
19
19
  var trimmedString = trim(toString(string));
20
- var result = n$ParseFloat(trimmedString);
20
+ var result = $parseFloat(trimmedString);
21
21
  return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
22
- } : n$ParseFloat;
22
+ } : $parseFloat;
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  var InternalStateModule = require('../internals/internal-state');
3
- var createIteratorConstructor = require('../internals/create-iterator-constructor');
3
+ var createIteratorConstructor = require('../internals/iterator-create-constructor');
4
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
4
5
  var isObject = require('../internals/is-object');
5
6
  var defineProperties = require('../internals/object-define-properties').f;
6
7
  var DESCRIPTORS = require('../internals/descriptors');
@@ -16,10 +17,10 @@ var $TypeError = TypeError;
16
17
 
17
18
  var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(start, end, option, type, zero, one) {
18
19
  if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) {
19
- throw new $TypeError(INCORRECT_RANGE);
20
+ throw $TypeError(INCORRECT_RANGE);
20
21
  }
21
22
  if (start === Infinity || start === -Infinity) {
22
- throw new $RangeError(INCORRECT_RANGE);
23
+ throw $RangeError(INCORRECT_RANGE);
23
24
  }
24
25
  var ifIncrease = end > start;
25
26
  var inclusiveEnd = false;
@@ -32,16 +33,16 @@ var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(sta
32
33
  } else if (typeof option == type) {
33
34
  step = option;
34
35
  } else {
35
- throw new $TypeError(INCORRECT_RANGE);
36
+ throw $TypeError(INCORRECT_RANGE);
36
37
  }
37
- if (step == null) {
38
+ if (isNullOrUndefined(step)) {
38
39
  step = ifIncrease ? one : -one;
39
40
  }
40
41
  if (typeof step != type) {
41
- throw new $TypeError(INCORRECT_RANGE);
42
+ throw $TypeError(INCORRECT_RANGE);
42
43
  }
43
44
  if (step === Infinity || step === -Infinity || (step === zero && start !== end)) {
44
- throw new $RangeError(INCORRECT_RANGE);
45
+ throw $RangeError(INCORRECT_RANGE);
45
46
  }
46
47
  // eslint-disable-next-line no-self-compare -- NaN check
47
48
  var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  var InternalStateModule = require('../internals/internal-state');
3
- var createIteratorConstructor = require('../internals/create-iterator-constructor');
3
+ var createIteratorConstructor = require('../internals/iterator-create-constructor');
4
4
  var hasOwn = require('../internals/has-own-property');
5
5
  var objectKeys = require('../internals/object-keys');
6
6
  var toObject = require('../internals/to-object');
@@ -5,6 +5,7 @@ var isForced = require('../internals/is-forced');
5
5
  var inspectSource = require('../internals/inspect-source');
6
6
  var wellKnownSymbol = require('../internals/well-known-symbol');
7
7
  var IS_BROWSER = require('../internals/engine-is-browser');
8
+ var IS_DENO = require('../internals/engine-is-deno');
8
9
  var IS_PURE = require('../internals/is-pure');
9
10
  var V8_VERSION = require('../internals/engine-v8-version');
10
11
 
@@ -25,18 +26,18 @@ var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
25
26
  // We can't use @@species feature detection in V8 since it causes
26
27
  // deoptimization and performance degradation
27
28
  // https://github.com/zloirock/core-js/issues/679
28
- if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
29
- // Detect correctness of subclassing with @@species support
30
- var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
31
- var FakePromise = function (exec) {
32
- exec(function () { /* empty */ }, function () { /* empty */ });
33
- };
34
- var constructor = promise.constructor = {};
35
- constructor[SPECIES] = FakePromise;
36
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
37
- if (!SUBCLASSING) return true;
29
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
30
+ // Detect correctness of subclassing with @@species support
31
+ var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
32
+ var FakePromise = function (exec) {
33
+ exec(function () { /* empty */ }, function () { /* empty */ });
34
+ };
35
+ var constructor = promise.constructor = {};
36
+ constructor[SPECIES] = FakePromise;
37
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
38
+ if (!SUBCLASSING) return true;
38
39
  // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
39
- return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
40
+ } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;
40
41
  });
41
42
 
42
43
  module.exports = {
@@ -1,8 +1,10 @@
1
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
2
+
1
3
  var $TypeError = TypeError;
2
4
 
3
5
  // `RequireObjectCoercible` abstract operation
4
6
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
5
7
  module.exports = function (it) {
6
- if (it == undefined) throw $TypeError("Can't call method on " + it);
8
+ if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
7
9
  return it;
8
10
  };
@@ -4,9 +4,9 @@ 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.23.5',
7
+ version: '3.25.0',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
10
- license: 'https://github.com/zloirock/core-js/blob/v3.23.5/LICENSE',
10
+ license: 'https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE',
11
11
  source: 'https://github.com/zloirock/core-js'
12
12
  });
@@ -1,5 +1,6 @@
1
1
  var anObject = require('../internals/an-object');
2
2
  var aConstructor = require('../internals/a-constructor');
3
+ var isNullOrUndefined = require('../internals/is-null-or-undefined');
3
4
  var wellKnownSymbol = require('../internals/well-known-symbol');
4
5
 
5
6
  var SPECIES = wellKnownSymbol('species');
@@ -9,5 +10,5 @@ var SPECIES = wellKnownSymbol('species');
9
10
  module.exports = function (O, defaultConstructor) {
10
11
  var C = anObject(O).constructor;
11
12
  var S;
12
- return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
13
+ return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);
13
14
  };
@@ -1,4 +1,4 @@
1
- var NATIVE_SYMBOL = require('../internals/native-symbol');
1
+ var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
2
2
 
3
3
  /* eslint-disable es-x/no-symbol -- safe */
4
4
  module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable es-x/no-symbol -- required for testing */
2
- var NATIVE_SYMBOL = require('../internals/native-symbol');
2
+ var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
3
3
 
4
4
  module.exports = NATIVE_SYMBOL
5
5
  && !Symbol.sham
@@ -0,0 +1,6 @@
1
+ var global = require('../internals/global');
2
+ var isCallable = require('../internals/is-callable');
3
+
4
+ var WeakMap = global.WeakMap;
5
+
6
+ module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
@@ -2,7 +2,7 @@ var global = require('../internals/global');
2
2
  var shared = require('../internals/shared');
3
3
  var hasOwn = require('../internals/has-own-property');
4
4
  var uid = require('../internals/uid');
5
- var NATIVE_SYMBOL = require('../internals/native-symbol');
5
+ var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
6
6
  var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
7
7
 
8
8
  var WellKnownSymbolsStore = shared('wks');
@@ -9,7 +9,7 @@ var proxyAccessor = require('../internals/proxy-accessor');
9
9
  var inheritIfRequired = require('../internals/inherit-if-required');
10
10
  var normalizeStringArgument = require('../internals/normalize-string-argument');
11
11
  var installErrorCause = require('../internals/install-error-cause');
12
- var clearErrorStack = require('../internals/clear-error-stack');
12
+ var clearErrorStack = require('../internals/error-stack-clear');
13
13
  var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');
14
14
  var DESCRIPTORS = require('../internals/descriptors');
15
15
  var IS_PURE = require('../internals/is-pure');
@@ -6,6 +6,7 @@ var wrapErrorConstructorWithCause = require('../internals/wrap-error-constructor
6
6
 
7
7
  var AGGREGATE_ERROR = 'AggregateError';
8
8
  var $AggregateError = getBuiltIn(AGGREGATE_ERROR);
9
+
9
10
  var FORCED = !fails(function () {
10
11
  return $AggregateError([1]).errors[0] !== 1;
11
12
  }) && fails(function () {
@@ -7,7 +7,7 @@ var copyConstructorProperties = require('../internals/copy-constructor-propertie
7
7
  var create = require('../internals/object-create');
8
8
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
9
9
  var createPropertyDescriptor = require('../internals/create-property-descriptor');
10
- var clearErrorStack = require('../internals/clear-error-stack');
10
+ var clearErrorStack = require('../internals/error-stack-clear');
11
11
  var installErrorCause = require('../internals/install-error-cause');
12
12
  var iterate = require('../internals/iterate');
13
13
  var normalizeStringArgument = require('../internals/normalize-string-argument');
@@ -23,7 +23,7 @@ var $AggregateError = function AggregateError(errors, message /* , options */) {
23
23
  var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
24
24
  var that;
25
25
  if (setPrototypeOf) {
26
- that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
26
+ that = setPrototypeOf($Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
27
27
  } else {
28
28
  that = isInstance ? this : create(AggregateErrorPrototype);
29
29
  createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');