core-js 3.22.3 → 3.22.8

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 (157) hide show
  1. package/actual/typed-array/at.js +1 -1
  2. package/full/typed-array/at.js +1 -1
  3. package/internals/a-callable.js +2 -3
  4. package/internals/a-constructor.js +2 -3
  5. package/internals/a-possible-prototype.js +3 -4
  6. package/internals/add-to-unscopables.js +2 -2
  7. package/internals/an-instance.js +2 -3
  8. package/internals/an-object.js +3 -4
  9. package/internals/array-buffer-view-core.js +4 -4
  10. package/internals/array-buffer.js +3 -3
  11. package/internals/array-copy-within.js +2 -1
  12. package/internals/array-from.js +3 -4
  13. package/internals/array-group-by.js +2 -3
  14. package/internals/array-reduce.js +2 -3
  15. package/internals/array-slice-simple.js +2 -3
  16. package/internals/array-species-constructor.js +3 -4
  17. package/internals/array-to-spliced.js +2 -4
  18. package/internals/array-with.js +2 -3
  19. package/internals/async-from-sync-iterator.js +2 -2
  20. package/internals/async-iterator-create-proxy.js +2 -2
  21. package/internals/async-iterator-iteration.js +2 -7
  22. package/internals/async-iterator-prototype.js +2 -2
  23. package/internals/classof.js +2 -3
  24. package/internals/collection-strong.js +3 -3
  25. package/internals/collection-weak.js +3 -3
  26. package/internals/collection.js +3 -3
  27. package/internals/composite-key.js +3 -4
  28. package/internals/date-to-iso-string.js +2 -3
  29. package/internals/date-to-primitive.js +2 -3
  30. package/internals/define-built-in-accessor.js +8 -0
  31. package/internals/define-built-in.js +20 -0
  32. package/internals/define-built-ins.js +6 -0
  33. package/internals/{set-global.js → define-global-property.js} +0 -0
  34. package/internals/define-iterator.js +4 -4
  35. package/internals/delete-property-or-throw.js +8 -0
  36. package/internals/does-not-exceed-safe-integer.js +7 -0
  37. package/internals/export.js +18 -19
  38. package/internals/fix-regexp-well-known-symbol-logic.js +3 -3
  39. package/internals/flatten-into-array.js +2 -4
  40. package/internals/function-bind.js +3 -4
  41. package/internals/get-iterator.js +2 -3
  42. package/internals/ieee754.js +2 -4
  43. package/internals/indexed-object.js +4 -5
  44. package/internals/is-iterable.js +2 -3
  45. package/internals/is-symbol.js +2 -3
  46. package/internals/iterate.js +2 -3
  47. package/internals/iterator-create-proxy.js +2 -2
  48. package/internals/iterators-core.js +2 -2
  49. package/internals/make-built-in.js +48 -0
  50. package/internals/map-upsert.js +2 -3
  51. package/internals/math-expm1.js +2 -1
  52. package/internals/math-fround.js +3 -2
  53. package/internals/math-log1p.js +2 -1
  54. package/internals/math-sign.js +2 -1
  55. package/internals/math-trunc.js +10 -0
  56. package/internals/not-a-regexp.js +2 -3
  57. package/internals/numeric-range-iterator.js +7 -8
  58. package/internals/object-define-property.js +2 -3
  59. package/internals/object-get-prototype-of.js +5 -5
  60. package/internals/ordinary-to-primitive.js +2 -3
  61. package/internals/regexp-exec-abstract.js +2 -3
  62. package/internals/require-object-coercible.js +2 -4
  63. package/internals/shared-store.js +2 -2
  64. package/internals/shared.js +2 -2
  65. package/internals/string-punycode-to-ascii.js +3 -4
  66. package/internals/string-repeat.js +2 -3
  67. package/internals/symbol-define-to-primitive.js +3 -3
  68. package/internals/to-big-int.js +12 -0
  69. package/internals/to-index.js +2 -3
  70. package/internals/to-integer-or-infinity.js +3 -4
  71. package/internals/to-object.js +2 -3
  72. package/internals/to-offset.js +2 -3
  73. package/internals/to-positive-integer.js +2 -3
  74. package/internals/to-primitive.js +2 -3
  75. package/internals/to-string.js +2 -3
  76. package/internals/try-to-string.js +2 -4
  77. package/internals/typed-array-constructor.js +3 -3
  78. package/internals/validate-arguments-length.js +2 -4
  79. package/modules/es.aggregate-error.cause.js +1 -1
  80. package/modules/es.aggregate-error.constructor.js +6 -7
  81. package/modules/es.array-buffer.constructor.js +1 -1
  82. package/modules/es.array.concat.js +4 -7
  83. package/modules/es.array.of.js +4 -4
  84. package/modules/es.array.slice.js +4 -5
  85. package/modules/es.array.sort.js +2 -1
  86. package/modules/es.array.splice.js +7 -11
  87. package/modules/es.data-view.constructor.js +1 -1
  88. package/modules/es.date.now.js +3 -4
  89. package/modules/es.date.to-json.js +1 -1
  90. package/modules/es.date.to-primitive.js +2 -2
  91. package/modules/es.date.to-string.js +2 -2
  92. package/modules/es.error.cause.js +2 -2
  93. package/modules/es.error.to-string.js +2 -2
  94. package/modules/es.function.has-instance.js +3 -2
  95. package/modules/es.json.stringify.js +1 -1
  96. package/modules/es.math.acosh.js +4 -3
  97. package/modules/es.math.asinh.js +2 -1
  98. package/modules/es.math.atanh.js +2 -1
  99. package/modules/es.math.cbrt.js +2 -1
  100. package/modules/es.math.clz32.js +2 -1
  101. package/modules/es.math.hypot.js +1 -1
  102. package/modules/es.math.sinh.js +2 -1
  103. package/modules/es.math.tanh.js +4 -3
  104. package/modules/es.math.trunc.js +2 -6
  105. package/modules/es.number.constructor.js +2 -2
  106. package/modules/es.number.to-exponential.js +7 -8
  107. package/modules/es.number.to-fixed.js +5 -6
  108. package/modules/es.object.assign.js +1 -1
  109. package/modules/es.object.to-string.js +2 -2
  110. package/modules/es.promise.catch.js +2 -2
  111. package/modules/es.promise.constructor.js +17 -21
  112. package/modules/es.promise.finally.js +2 -2
  113. package/modules/es.regexp.constructor.js +2 -2
  114. package/modules/es.regexp.dot-all.js +5 -6
  115. package/modules/es.regexp.flags.js +2 -2
  116. package/modules/es.regexp.sticky.js +5 -6
  117. package/modules/es.regexp.test.js +2 -3
  118. package/modules/es.regexp.to-string.js +2 -2
  119. package/modules/es.string.from-code-point.js +3 -4
  120. package/modules/es.string.match-all.js +4 -5
  121. package/modules/es.string.replace-all.js +2 -3
  122. package/modules/es.symbol.constructor.js +5 -5
  123. package/modules/es.symbol.description.js +1 -1
  124. package/modules/es.typed-array.fill.js +18 -9
  125. package/modules/es.weak-map.constructor.js +2 -2
  126. package/modules/esnext.array.last-index.js +2 -2
  127. package/modules/esnext.array.last-item.js +2 -2
  128. package/modules/esnext.array.to-reversed.js +2 -3
  129. package/modules/esnext.array.to-sorted.js +2 -3
  130. package/modules/esnext.array.to-spliced.js +3 -4
  131. package/modules/esnext.array.with.js +2 -3
  132. package/modules/esnext.async-iterator.constructor.js +1 -1
  133. package/modules/esnext.async-iterator.reduce.js +2 -3
  134. package/modules/esnext.composite-key.js +2 -3
  135. package/modules/esnext.iterator.constructor.js +1 -1
  136. package/modules/esnext.iterator.flat-map.js +2 -3
  137. package/modules/esnext.iterator.reduce.js +2 -3
  138. package/modules/esnext.map.merge.js +1 -1
  139. package/modules/esnext.map.reduce.js +2 -3
  140. package/modules/esnext.map.update.js +2 -3
  141. package/modules/esnext.math.seeded-prng.js +2 -3
  142. package/modules/esnext.math.signbit.js +3 -1
  143. package/modules/esnext.number.from-string.js +8 -9
  144. package/modules/esnext.observable.constructor.js +12 -12
  145. package/modules/esnext.set.reduce.js +2 -3
  146. package/modules/esnext.string.cooked.js +2 -3
  147. package/modules/esnext.typed-array.to-spliced.js +1 -1
  148. package/modules/esnext.typed-array.with.js +9 -0
  149. package/modules/web.dom-exception.constructor.js +10 -10
  150. package/modules/web.dom-exception.stack.js +1 -1
  151. package/modules/web.queue-microtask.js +1 -1
  152. package/modules/web.structured-clone.js +21 -9
  153. package/modules/web.url-search-params.constructor.js +8 -8
  154. package/modules/web.url.constructor.js +43 -45
  155. package/package.json +2 -3
  156. package/internals/redefine-all.js +0 -6
  157. package/internals/redefine.js +0 -46
@@ -23,7 +23,7 @@ var getOwnPropertyDescriptorModule = require('../internals/object-get-own-proper
23
23
  var definePropertyModule = require('../internals/object-define-property');
24
24
  var definePropertiesModule = require('../internals/object-define-properties');
25
25
  var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');
26
- var redefine = require('../internals/redefine');
26
+ var defineBuiltIn = require('../internals/define-built-in');
27
27
  var shared = require('../internals/shared');
28
28
  var sharedKey = require('../internals/shared-key');
29
29
  var hiddenKeys = require('../internals/hidden-keys');
@@ -174,11 +174,11 @@ if (!NATIVE_SYMBOL) {
174
174
 
175
175
  SymbolPrototype = $Symbol[PROTOTYPE];
176
176
 
177
- redefine(SymbolPrototype, 'toString', function toString() {
177
+ defineBuiltIn(SymbolPrototype, 'toString', function toString() {
178
178
  return getInternalState(this).tag;
179
179
  });
180
180
 
181
- redefine($Symbol, 'withoutSetter', function (description) {
181
+ defineBuiltIn($Symbol, 'withoutSetter', function (description) {
182
182
  return wrap(uid(description), description);
183
183
  });
184
184
 
@@ -202,12 +202,12 @@ if (!NATIVE_SYMBOL) {
202
202
  }
203
203
  });
204
204
  if (!IS_PURE) {
205
- redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
205
+ defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
206
206
  }
207
207
  }
208
208
  }
209
209
 
210
- $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
210
+ $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
211
211
  Symbol: $Symbol
212
212
  });
213
213
 
@@ -53,7 +53,7 @@ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototy
53
53
  }
54
54
  });
55
55
 
56
- $({ global: true, forced: true }, {
56
+ $({ global: true, constructor: true, forced: true }, {
57
57
  Symbol: SymbolWrapper
58
58
  });
59
59
  }
@@ -1,20 +1,29 @@
1
1
  'use strict';
2
2
  var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
3
- var call = require('../internals/function-call');
4
3
  var $fill = require('../internals/array-fill');
4
+ var toBigInt = require('../internals/to-big-int');
5
+ var classof = require('../internals/classof');
6
+ var call = require('../internals/function-call');
7
+ var uncurryThis = require('../internals/function-uncurry-this');
8
+ var fails = require('../internals/fails');
5
9
 
6
10
  var aTypedArray = ArrayBufferViewCore.aTypedArray;
7
11
  var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
12
+ var slice = uncurryThis(''.slice);
13
+
14
+ // V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18
15
+ var CONVERSION_BUG = fails(function () {
16
+ var count = 0;
17
+ // eslint-disable-next-line es-x/no-typed-arrays -- safe
18
+ new Int8Array(2).fill({ valueOf: function () { return count++; } });
19
+ return count !== 1;
20
+ });
8
21
 
9
22
  // `%TypedArray%.prototype.fill` method
10
23
  // https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill
11
24
  exportTypedArrayMethod('fill', function fill(value /* , start, end */) {
12
25
  var length = arguments.length;
13
- return call(
14
- $fill,
15
- aTypedArray(this),
16
- value,
17
- length > 1 ? arguments[1] : undefined,
18
- length > 2 ? arguments[2] : undefined
19
- );
20
- });
26
+ aTypedArray(this);
27
+ var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
28
+ return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined);
29
+ }, CONVERSION_BUG);
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var global = require('../internals/global');
3
3
  var uncurryThis = require('../internals/function-uncurry-this');
4
- var redefineAll = require('../internals/redefine-all');
4
+ var defineBuiltIns = require('../internals/define-built-ins');
5
5
  var InternalMetadataModule = require('../internals/internal-metadata');
6
6
  var collection = require('../internals/collection');
7
7
  var collectionWeak = require('../internals/collection-weak');
@@ -34,7 +34,7 @@ if (NATIVE_WEAK_MAP && IS_IE11) {
34
34
  var nativeHas = uncurryThis(WeakMapPrototype.has);
35
35
  var nativeGet = uncurryThis(WeakMapPrototype.get);
36
36
  var nativeSet = uncurryThis(WeakMapPrototype.set);
37
- redefineAll(WeakMapPrototype, {
37
+ defineBuiltIns(WeakMapPrototype, {
38
38
  'delete': function (key) {
39
39
  if (isObject(key) && !isExtensible(key)) {
40
40
  var state = enforceInternalState(this);
@@ -4,12 +4,12 @@ var DESCRIPTORS = require('../internals/descriptors');
4
4
  var addToUnscopables = require('../internals/add-to-unscopables');
5
5
  var toObject = require('../internals/to-object');
6
6
  var lengthOfArrayLike = require('../internals/length-of-array-like');
7
- var defineProperty = require('../internals/object-define-property').f;
7
+ var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
8
8
 
9
9
  // `Array.prototype.lastIndex` getter
10
10
  // https://github.com/keithamus/proposal-array-last
11
11
  if (DESCRIPTORS) {
12
- defineProperty(Array.prototype, 'lastIndex', {
12
+ defineBuiltInAccessor(Array.prototype, 'lastIndex', {
13
13
  configurable: true,
14
14
  get: function lastIndex() {
15
15
  var O = toObject(this);
@@ -4,12 +4,12 @@ var DESCRIPTORS = require('../internals/descriptors');
4
4
  var addToUnscopables = require('../internals/add-to-unscopables');
5
5
  var toObject = require('../internals/to-object');
6
6
  var lengthOfArrayLike = require('../internals/length-of-array-like');
7
- var defineProperty = require('../internals/object-define-property').f;
7
+ var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
8
8
 
9
9
  // `Array.prototype.lastIndex` accessor
10
10
  // https://github.com/keithamus/proposal-array-last
11
11
  if (DESCRIPTORS) {
12
- defineProperty(Array.prototype, 'lastItem', {
12
+ defineBuiltInAccessor(Array.prototype, 'lastItem', {
13
13
  configurable: true,
14
14
  get: function lastItem() {
15
15
  var O = toObject(this);
@@ -1,17 +1,16 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var arrayToReversed = require('../internals/array-to-reversed');
5
4
  var toIndexedObject = require('../internals/to-indexed-object');
6
5
  var addToUnscopables = require('../internals/add-to-unscopables');
7
6
 
8
- var Array = global.Array;
7
+ var $Array = Array;
9
8
 
10
9
  // `Array.prototype.toReversed` method
11
10
  // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed
12
11
  $({ target: 'Array', proto: true }, {
13
12
  toReversed: function toReversed() {
14
- return arrayToReversed(toIndexedObject(this), Array);
13
+ return arrayToReversed(toIndexedObject(this), $Array);
15
14
  }
16
15
  });
17
16
 
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var uncurryThis = require('../internals/function-uncurry-this');
5
4
  var aCallable = require('../internals/a-callable');
6
5
  var toIndexedObject = require('../internals/to-indexed-object');
@@ -8,7 +7,7 @@ var arrayFromConstructorAndList = require('../internals/array-from-constructor-a
8
7
  var getVirtual = require('../internals/entry-virtual');
9
8
  var addToUnscopables = require('../internals/add-to-unscopables');
10
9
 
11
- var Array = global.Array;
10
+ var $Array = Array;
12
11
  var sort = uncurryThis(getVirtual('Array').sort);
13
12
 
14
13
  // `Array.prototype.toSorted` method
@@ -17,7 +16,7 @@ $({ target: 'Array', proto: true }, {
17
16
  toSorted: function toSorted(compareFn) {
18
17
  if (compareFn !== undefined) aCallable(compareFn);
19
18
  var O = toIndexedObject(this);
20
- var A = arrayFromConstructorAndList(Array, O);
19
+ var A = arrayFromConstructorAndList($Array, O);
21
20
  return sort(A, compareFn);
22
21
  }
23
22
  });
@@ -1,19 +1,18 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var toIndexedObject = require('../internals/to-indexed-object');
5
4
  var arraySlice = require('../internals/array-slice');
6
5
  var arrayToSpliced = require('../internals/array-to-spliced');
7
6
  var addToUnscopables = require('../internals/add-to-unscopables');
8
7
 
9
- var Array = global.Array;
8
+ var $Array = Array;
10
9
 
11
10
  // `Array.prototype.toSpliced` method
12
11
  // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSpliced
13
- $({ target: 'Array', proto: true }, {
12
+ $({ target: 'Array', proto: true, arity: 2 }, {
14
13
  // eslint-disable-next-line no-unused-vars -- required for .length
15
14
  toSpliced: function toSpliced(start, deleteCount /* , ...items */) {
16
- return arrayToSpliced(toIndexedObject(this), Array, arraySlice(arguments));
15
+ return arrayToSpliced(toIndexedObject(this), $Array, arraySlice(arguments));
17
16
  }
18
17
  });
19
18
 
@@ -1,15 +1,14 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var arrayWith = require('../internals/array-with');
5
4
  var toIndexedObject = require('../internals/to-indexed-object');
6
5
 
7
- var Array = global.Array;
6
+ var $Array = Array;
8
7
 
9
8
  // `Array.prototype.with` method
10
9
  // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with
11
10
  $({ target: 'Array', proto: true }, {
12
11
  'with': function (index, value) {
13
- return arrayWith(toIndexedObject(this), Array, index, value);
12
+ return arrayWith(toIndexedObject(this), $Array, index, value);
14
13
  }
15
14
  });
@@ -24,6 +24,6 @@ if (IS_PURE || !hasOwn(AsyncIteratorPrototype, 'constructor') || AsyncIteratorPr
24
24
  createNonEnumerableProperty(AsyncIteratorPrototype, 'constructor', AsyncIteratorConstructor);
25
25
  }
26
26
 
27
- $({ global: true, forced: IS_PURE }, {
27
+ $({ global: true, constructor: true, forced: IS_PURE }, {
28
28
  AsyncIterator: AsyncIteratorConstructor
29
29
  });
@@ -1,14 +1,13 @@
1
1
  'use strict';
2
2
  // https://github.com/tc39/proposal-iterator-helpers
3
3
  var $ = require('../internals/export');
4
- var global = require('../internals/global');
5
4
  var call = require('../internals/function-call');
6
5
  var aCallable = require('../internals/a-callable');
7
6
  var anObject = require('../internals/an-object');
8
7
  var getBuiltIn = require('../internals/get-built-in');
9
8
 
10
9
  var Promise = getBuiltIn('Promise');
11
- var TypeError = global.TypeError;
10
+ var $TypeError = TypeError;
12
11
 
13
12
  $({ target: 'AsyncIterator', proto: true, real: true, forced: true }, {
14
13
  reduce: function reduce(reducer /* , initialValue */) {
@@ -24,7 +23,7 @@ $({ target: 'AsyncIterator', proto: true, real: true, forced: true }, {
24
23
  Promise.resolve(anObject(call(next, iterator))).then(function (step) {
25
24
  try {
26
25
  if (anObject(step).done) {
27
- noInitial ? reject(TypeError('Reduce of empty iterator with no initial value')) : resolve(accumulator);
26
+ noInitial ? reject($TypeError('Reduce of empty iterator with no initial value')) : resolve(accumulator);
28
27
  } else {
29
28
  var value = step.value;
30
29
  if (noInitial) {
@@ -1,11 +1,10 @@
1
1
  var $ = require('../internals/export');
2
- var global = require('../internals/global');
3
2
  var apply = require('../internals/function-apply');
4
3
  var getCompositeKeyNode = require('../internals/composite-key');
5
4
  var getBuiltIn = require('../internals/get-built-in');
6
5
  var create = require('../internals/object-create');
7
6
 
8
- var Object = global.Object;
7
+ var $Object = Object;
9
8
 
10
9
  var initializer = function () {
11
10
  var freeze = getBuiltIn('Object', 'freeze');
@@ -15,6 +14,6 @@ var initializer = function () {
15
14
  // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey
16
15
  $({ global: true, forced: true }, {
17
16
  compositeKey: function compositeKey() {
18
- return apply(getCompositeKeyNode, Object, arguments).get('object', initializer);
17
+ return apply(getCompositeKeyNode, $Object, arguments).get('object', initializer);
19
18
  }
20
19
  });
@@ -36,6 +36,6 @@ if (FORCED || !hasOwn(IteratorPrototype, 'constructor') || IteratorPrototype.con
36
36
 
37
37
  IteratorConstructor.prototype = IteratorPrototype;
38
38
 
39
- $({ global: true, forced: FORCED }, {
39
+ $({ global: true, constructor: true, forced: FORCED }, {
40
40
  Iterator: IteratorConstructor
41
41
  });
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
  // https://github.com/tc39/proposal-iterator-helpers
3
3
  var $ = require('../internals/export');
4
- var global = require('../internals/global');
5
4
  var call = require('../internals/function-call');
6
5
  var aCallable = require('../internals/a-callable');
7
6
  var anObject = require('../internals/an-object');
@@ -9,7 +8,7 @@ var getIteratorMethod = require('../internals/get-iterator-method');
9
8
  var createIteratorProxy = require('../internals/iterator-create-proxy');
10
9
  var iteratorClose = require('../internals/iterator-close');
11
10
 
12
- var TypeError = global.TypeError;
11
+ var $TypeError = TypeError;
13
12
 
14
13
  var IteratorProxy = createIteratorProxy(function () {
15
14
  var iterator = this.iterator;
@@ -32,7 +31,7 @@ var IteratorProxy = createIteratorProxy(function () {
32
31
  iteratorMethod = getIteratorMethod(mapped);
33
32
 
34
33
  if (!iteratorMethod) {
35
- throw TypeError('.flatMap callback should return an iterable object');
34
+ throw $TypeError('.flatMap callback should return an iterable object');
36
35
  }
37
36
 
38
37
  this.innerIterator = innerIterator = anObject(call(iteratorMethod, mapped));
@@ -1,12 +1,11 @@
1
1
  'use strict';
2
2
  // https://github.com/tc39/proposal-iterator-helpers
3
3
  var $ = require('../internals/export');
4
- var global = require('../internals/global');
5
4
  var iterate = require('../internals/iterate');
6
5
  var aCallable = require('../internals/a-callable');
7
6
  var anObject = require('../internals/an-object');
8
7
 
9
- var TypeError = global.TypeError;
8
+ var $TypeError = TypeError;
10
9
 
11
10
  $({ target: 'Iterator', proto: true, real: true, forced: true }, {
12
11
  reduce: function reduce(reducer /* , initialValue */) {
@@ -22,7 +21,7 @@ $({ target: 'Iterator', proto: true, real: true, forced: true }, {
22
21
  accumulator = reducer(accumulator, value);
23
22
  }
24
23
  }, { IS_ITERATOR: true });
25
- if (noInitial) throw TypeError('Reduce of empty iterator with no initial value');
24
+ if (noInitial) throw $TypeError('Reduce of empty iterator with no initial value');
26
25
  return accumulator;
27
26
  }
28
27
  });
@@ -6,7 +6,7 @@ var iterate = require('../internals/iterate');
6
6
 
7
7
  // `Map.prototype.merge` method
8
8
  // https://github.com/tc39/proposal-collection-methods
9
- $({ target: 'Map', proto: true, real: true, forced: true }, {
9
+ $({ target: 'Map', proto: true, real: true, arity: 1, forced: true }, {
10
10
  // eslint-disable-next-line no-unused-vars -- required for `.length`
11
11
  merge: function merge(iterable /* ...iterables */) {
12
12
  var map = anObject(this);
@@ -1,12 +1,11 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var anObject = require('../internals/an-object');
5
4
  var aCallable = require('../internals/a-callable');
6
5
  var getMapIterator = require('../internals/get-map-iterator');
7
6
  var iterate = require('../internals/iterate');
8
7
 
9
- var TypeError = global.TypeError;
8
+ var $TypeError = TypeError;
10
9
 
11
10
  // `Map.prototype.reduce` method
12
11
  // https://github.com/tc39/proposal-collection-methods
@@ -25,7 +24,7 @@ $({ target: 'Map', proto: true, real: true, forced: true }, {
25
24
  accumulator = callbackfn(accumulator, value, key, map);
26
25
  }
27
26
  }, { AS_ENTRIES: true, IS_ITERATOR: true });
28
- if (noInitial) throw TypeError('Reduce of empty map with no initial value');
27
+ if (noInitial) throw $TypeError('Reduce of empty map with no initial value');
29
28
  return accumulator;
30
29
  }
31
30
  });
@@ -1,11 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var call = require('../internals/function-call');
5
4
  var anObject = require('../internals/an-object');
6
5
  var aCallable = require('../internals/a-callable');
7
6
 
8
- var TypeError = global.TypeError;
7
+ var $TypeError = TypeError;
9
8
 
10
9
  // `Set.prototype.update` method
11
10
  // https://github.com/tc39/proposal-collection-methods
@@ -19,7 +18,7 @@ $({ target: 'Map', proto: true, real: true, forced: true }, {
19
18
  aCallable(callback);
20
19
  var isPresentInMap = call(has, map, key);
21
20
  if (!isPresentInMap && length < 3) {
22
- throw TypeError('Updating absent value');
21
+ throw $TypeError('Updating absent value');
23
22
  }
24
23
  var value = isPresentInMap ? call(get, map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map);
25
24
  call(set, map, key, callback(value, key, map));
@@ -1,5 +1,4 @@
1
1
  var $ = require('../internals/export');
2
- var global = require('../internals/global');
3
2
  var anObject = require('../internals/an-object');
4
3
  var numberIsFinite = require('../internals/number-is-finite');
5
4
  var createIteratorConstructor = require('../internals/create-iterator-constructor');
@@ -10,7 +9,7 @@ var SEEDED_RANDOM_GENERATOR = SEEDED_RANDOM + ' Generator';
10
9
  var SEED_TYPE_ERROR = 'Math.seededPRNG() argument should have a "seed" field with a finite value.';
11
10
  var setInternalState = InternalStateModule.set;
12
11
  var getInternalState = InternalStateModule.getterFor(SEEDED_RANDOM_GENERATOR);
13
- var TypeError = global.TypeError;
12
+ var $TypeError = TypeError;
14
13
 
15
14
  var $SeededRandomGenerator = createIteratorConstructor(function SeededRandomGenerator(seed) {
16
15
  setInternalState(this, {
@@ -29,7 +28,7 @@ var $SeededRandomGenerator = createIteratorConstructor(function SeededRandomGene
29
28
  $({ target: 'Math', stat: true, forced: true }, {
30
29
  seededPRNG: function seededPRNG(it) {
31
30
  var seed = anObject(it).seed;
32
- if (!numberIsFinite(seed)) throw TypeError(SEED_TYPE_ERROR);
31
+ if (!numberIsFinite(seed)) throw $TypeError(SEED_TYPE_ERROR);
33
32
  return new $SeededRandomGenerator(seed);
34
33
  }
35
34
  });
@@ -4,6 +4,8 @@ var $ = require('../internals/export');
4
4
  // https://github.com/tc39/proposal-Math.signbit
5
5
  $({ target: 'Math', stat: true, forced: true }, {
6
6
  signbit: function signbit(x) {
7
- return (x = +x) == x && x == 0 ? 1 / x == -Infinity : x < 0;
7
+ var n = +x;
8
+ // eslint-disable-next-line no-self-compare -- NaN check
9
+ return n == n && n == 0 ? 1 / n == -Infinity : n < 0;
8
10
  }
9
11
  });
@@ -1,15 +1,14 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var uncurryThis = require('../internals/function-uncurry-this');
5
4
  var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
6
5
  var parseInt = require('../internals/number-parse-int');
7
6
 
8
7
  var INVALID_NUMBER_REPRESENTATION = 'Invalid number representation';
9
8
  var INVALID_RADIX = 'Invalid radix';
10
- var RangeError = global.RangeError;
11
- var SyntaxError = global.SyntaxError;
12
- var TypeError = global.TypeError;
9
+ var $RangeError = RangeError;
10
+ var $SyntaxError = SyntaxError;
11
+ var $TypeError = TypeError;
13
12
  var valid = /^[\da-z]+$/;
14
13
  var charAt = uncurryThis(''.charAt);
15
14
  var exec = uncurryThis(valid.exec);
@@ -22,17 +21,17 @@ $({ target: 'Number', stat: true, forced: true }, {
22
21
  fromString: function fromString(string, radix) {
23
22
  var sign = 1;
24
23
  var R, mathNum;
25
- if (typeof string != 'string') throw TypeError(INVALID_NUMBER_REPRESENTATION);
26
- if (!string.length) throw SyntaxError(INVALID_NUMBER_REPRESENTATION);
24
+ if (typeof string != 'string') throw $TypeError(INVALID_NUMBER_REPRESENTATION);
25
+ if (!string.length) throw $SyntaxError(INVALID_NUMBER_REPRESENTATION);
27
26
  if (charAt(string, 0) == '-') {
28
27
  sign = -1;
29
28
  string = stringSlice(string, 1);
30
- if (!string.length) throw SyntaxError(INVALID_NUMBER_REPRESENTATION);
29
+ if (!string.length) throw $SyntaxError(INVALID_NUMBER_REPRESENTATION);
31
30
  }
32
31
  R = radix === undefined ? 10 : toIntegerOrInfinity(radix);
33
- if (R < 2 || R > 36) throw RangeError(INVALID_RADIX);
32
+ if (R < 2 || R > 36) throw $RangeError(INVALID_RADIX);
34
33
  if (!exec(valid, string) || numberToString(mathNum = parseInt(string, R), R) !== string) {
35
- throw SyntaxError(INVALID_NUMBER_REPRESENTATION);
34
+ throw $SyntaxError(INVALID_NUMBER_REPRESENTATION);
36
35
  }
37
36
  return sign * mathNum;
38
37
  }
@@ -10,9 +10,9 @@ var anObject = require('../internals/an-object');
10
10
  var isObject = require('../internals/is-object');
11
11
  var anInstance = require('../internals/an-instance');
12
12
  var getMethod = require('../internals/get-method');
13
- var defineProperty = require('../internals/object-define-property').f;
14
- var redefine = require('../internals/redefine');
15
- var redefineAll = require('../internals/redefine-all');
13
+ var defineBuiltIn = require('../internals/define-built-in');
14
+ var defineBuiltIns = require('../internals/define-built-ins');
15
+ var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
16
16
  var hostReportErrors = require('../internals/host-report-errors');
17
17
  var wellKnownSymbol = require('../internals/well-known-symbol');
18
18
  var InternalStateModule = require('../internals/internal-state');
@@ -83,7 +83,7 @@ var Subscription = function (observer, subscriber) {
83
83
  } if (subscriptionState.isClosed()) subscriptionState.clean();
84
84
  };
85
85
 
86
- Subscription.prototype = redefineAll({}, {
86
+ Subscription.prototype = defineBuiltIns({}, {
87
87
  unsubscribe: function unsubscribe() {
88
88
  var subscriptionState = getSubscriptionInternalState(this);
89
89
  if (!subscriptionState.isClosed()) {
@@ -93,9 +93,9 @@ Subscription.prototype = redefineAll({}, {
93
93
  }
94
94
  });
95
95
 
96
- if (DESCRIPTORS) defineProperty(Subscription.prototype, 'closed', {
96
+ if (DESCRIPTORS) defineBuiltInAccessor(Subscription.prototype, 'closed', {
97
97
  configurable: true,
98
- get: function () {
98
+ get: function closed() {
99
99
  return getSubscriptionInternalState(this).isClosed();
100
100
  }
101
101
  });
@@ -108,7 +108,7 @@ var SubscriptionObserver = function (subscriptionState) {
108
108
  if (!DESCRIPTORS) this.closed = false;
109
109
  };
110
110
 
111
- SubscriptionObserver.prototype = redefineAll({}, {
111
+ SubscriptionObserver.prototype = defineBuiltIns({}, {
112
112
  next: function next(value) {
113
113
  var subscriptionState = getSubscriptionObserverInternalState(this).subscriptionState;
114
114
  if (!subscriptionState.isClosed()) {
@@ -150,9 +150,9 @@ SubscriptionObserver.prototype = redefineAll({}, {
150
150
  }
151
151
  });
152
152
 
153
- if (DESCRIPTORS) defineProperty(SubscriptionObserver.prototype, 'closed', {
153
+ if (DESCRIPTORS) defineBuiltInAccessor(SubscriptionObserver.prototype, 'closed', {
154
154
  configurable: true,
155
- get: function () {
155
+ get: function closed() {
156
156
  return getSubscriptionObserverInternalState(this).subscriptionState.isClosed();
157
157
  }
158
158
  });
@@ -167,7 +167,7 @@ var $Observable = function Observable(subscriber) {
167
167
 
168
168
  var ObservablePrototype = $Observable.prototype;
169
169
 
170
- redefineAll(ObservablePrototype, {
170
+ defineBuiltIns(ObservablePrototype, {
171
171
  subscribe: function subscribe(observer) {
172
172
  var length = arguments.length;
173
173
  return new Subscription(isCallable(observer) ? {
@@ -178,9 +178,9 @@ redefineAll(ObservablePrototype, {
178
178
  }
179
179
  });
180
180
 
181
- redefine(ObservablePrototype, $$OBSERVABLE, function () { return this; });
181
+ defineBuiltIn(ObservablePrototype, $$OBSERVABLE, function () { return this; });
182
182
 
183
- $({ global: true, forced: OBSERVABLE_FORCED }, {
183
+ $({ global: true, constructor: true, forced: OBSERVABLE_FORCED }, {
184
184
  Observable: $Observable
185
185
  });
186
186
 
@@ -1,12 +1,11 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var aCallable = require('../internals/a-callable');
5
4
  var anObject = require('../internals/an-object');
6
5
  var getSetIterator = require('../internals/get-set-iterator');
7
6
  var iterate = require('../internals/iterate');
8
7
 
9
- var TypeError = global.TypeError;
8
+ var $TypeError = TypeError;
10
9
 
11
10
  // `Set.prototype.reduce` method
12
11
  // https://github.com/tc39/proposal-collection-methods
@@ -25,7 +24,7 @@ $({ target: 'Set', proto: true, real: true, forced: true }, {
25
24
  accumulator = callbackfn(accumulator, value, value, set);
26
25
  }
27
26
  }, { IS_ITERATOR: true });
28
- if (noInitial) throw TypeError('Reduce of empty set with no initial value');
27
+ if (noInitial) throw $TypeError('Reduce of empty set with no initial value');
29
28
  return accumulator;
30
29
  }
31
30
  });
@@ -1,11 +1,10 @@
1
1
  var $ = require('../internals/export');
2
- var global = require('../internals/global');
3
2
  var uncurryThis = require('../internals/function-uncurry-this');
4
3
  var toIndexedObject = require('../internals/to-indexed-object');
5
4
  var toString = require('../internals/to-string');
6
5
  var lengthOfArrayLike = require('../internals/length-of-array-like');
7
6
 
8
- var TypeError = global.TypeError;
7
+ var $TypeError = TypeError;
9
8
  var ArrayPrototype = Array.prototype;
10
9
  var push = uncurryThis(ArrayPrototype.push);
11
10
  var join = uncurryThis(ArrayPrototype.join);
@@ -21,7 +20,7 @@ $({ target: 'String', stat: true, forced: true }, {
21
20
  var i = 0;
22
21
  while (literalSegments > i) {
23
22
  var nextVal = cookedTemplate[i++];
24
- if (nextVal === undefined) throw TypeError('Incorrect template');
23
+ if (nextVal === undefined) throw $TypeError('Incorrect template');
25
24
  push(elements, toString(nextVal));
26
25
  if (i === literalSegments) return join(elements, '');
27
26
  if (i < argumentsLength) push(elements, toString(arguments[i]));
@@ -12,4 +12,4 @@ var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
12
12
  // eslint-disable-next-line no-unused-vars -- required for .length
13
13
  exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) {
14
14
  return arrayToSpliced(aTypedArray(this), this[TYPED_ARRAY_CONSTRUCTOR], arraySlice(arguments));
15
- });
15
+ }, { arity: 2 });
@@ -1,13 +1,22 @@
1
1
  'use strict';
2
2
  var arrayWith = require('../internals/array-with');
3
3
  var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
4
+ // var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
5
+ // var toBigInt = require('../internals/to-big-int');
6
+ // var classof = require('../internals/classof');
7
+ // var uncurryThis = require('../internals/function-uncurry-this');
4
8
 
5
9
  var aTypedArray = ArrayBufferViewCore.aTypedArray;
6
10
  var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
7
11
  var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
12
+ // var slice = uncurryThis(''.slice);
8
13
 
9
14
  // `%TypedArray%.prototype.with` method
10
15
  // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with
11
16
  exportTypedArrayMethod('with', { 'with': function (index, value) {
17
+ // aTypedArray(this);
18
+ // var relativeIndex = toIntegerOrInfinity(index);
19
+ // var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
20
+ // return arrayWith(this, this[TYPED_ARRAY_CONSTRUCTOR], relativeIndex, actualValue);
12
21
  return arrayWith(aTypedArray(this), this[TYPED_ARRAY_CONSTRUCTOR], index, value);
13
22
  } }['with']);