core-js 3.22.5 → 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 (105) 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-copy-within.js +2 -1
  10. package/internals/array-from.js +3 -4
  11. package/internals/array-group-by.js +2 -3
  12. package/internals/array-reduce.js +2 -3
  13. package/internals/array-slice-simple.js +2 -3
  14. package/internals/array-species-constructor.js +3 -4
  15. package/internals/array-to-spliced.js +2 -4
  16. package/internals/array-with.js +2 -3
  17. package/internals/async-iterator-iteration.js +2 -7
  18. package/internals/classof.js +2 -3
  19. package/internals/composite-key.js +3 -4
  20. package/internals/date-to-iso-string.js +2 -3
  21. package/internals/date-to-primitive.js +2 -3
  22. package/internals/define-built-in.js +12 -17
  23. package/internals/{set-global.js → define-global-property.js} +0 -0
  24. package/internals/delete-property-or-throw.js +8 -0
  25. package/internals/does-not-exceed-safe-integer.js +7 -0
  26. package/internals/export.js +16 -16
  27. package/internals/flatten-into-array.js +2 -4
  28. package/internals/function-bind.js +3 -4
  29. package/internals/get-iterator.js +2 -3
  30. package/internals/ieee754.js +2 -4
  31. package/internals/indexed-object.js +4 -5
  32. package/internals/is-iterable.js +2 -3
  33. package/internals/is-symbol.js +2 -3
  34. package/internals/iterate.js +2 -3
  35. package/internals/make-built-in.js +6 -5
  36. package/internals/map-upsert.js +2 -3
  37. package/internals/math-expm1.js +2 -1
  38. package/internals/math-fround.js +3 -2
  39. package/internals/math-log1p.js +2 -1
  40. package/internals/math-sign.js +2 -1
  41. package/internals/math-trunc.js +10 -0
  42. package/internals/not-a-regexp.js +2 -3
  43. package/internals/numeric-range-iterator.js +7 -8
  44. package/internals/object-define-property.js +2 -3
  45. package/internals/object-get-prototype-of.js +5 -5
  46. package/internals/ordinary-to-primitive.js +2 -3
  47. package/internals/regexp-exec-abstract.js +2 -3
  48. package/internals/require-object-coercible.js +2 -4
  49. package/internals/shared-store.js +2 -2
  50. package/internals/shared.js +2 -2
  51. package/internals/string-punycode-to-ascii.js +3 -4
  52. package/internals/string-repeat.js +2 -3
  53. package/internals/to-big-int.js +12 -0
  54. package/internals/to-index.js +2 -3
  55. package/internals/to-integer-or-infinity.js +3 -4
  56. package/internals/to-object.js +2 -3
  57. package/internals/to-offset.js +2 -3
  58. package/internals/to-positive-integer.js +2 -3
  59. package/internals/to-primitive.js +2 -3
  60. package/internals/to-string.js +2 -3
  61. package/internals/try-to-string.js +2 -4
  62. package/internals/validate-arguments-length.js +2 -4
  63. package/modules/es.aggregate-error.constructor.js +5 -6
  64. package/modules/es.array.concat.js +3 -6
  65. package/modules/es.array.of.js +4 -4
  66. package/modules/es.array.slice.js +4 -5
  67. package/modules/es.array.sort.js +2 -1
  68. package/modules/es.array.splice.js +7 -11
  69. package/modules/es.date.now.js +3 -4
  70. package/modules/es.math.acosh.js +4 -3
  71. package/modules/es.math.asinh.js +2 -1
  72. package/modules/es.math.atanh.js +2 -1
  73. package/modules/es.math.cbrt.js +2 -1
  74. package/modules/es.math.clz32.js +2 -1
  75. package/modules/es.math.sinh.js +2 -1
  76. package/modules/es.math.tanh.js +4 -3
  77. package/modules/es.math.trunc.js +2 -6
  78. package/modules/es.number.to-exponential.js +7 -8
  79. package/modules/es.number.to-fixed.js +5 -6
  80. package/modules/es.regexp.dot-all.js +2 -3
  81. package/modules/es.regexp.sticky.js +2 -3
  82. package/modules/es.regexp.test.js +2 -3
  83. package/modules/es.string.from-code-point.js +2 -3
  84. package/modules/es.string.match-all.js +2 -3
  85. package/modules/es.string.replace-all.js +2 -3
  86. package/modules/es.typed-array.fill.js +18 -9
  87. package/modules/esnext.array.to-reversed.js +2 -3
  88. package/modules/esnext.array.to-sorted.js +2 -3
  89. package/modules/esnext.array.to-spliced.js +2 -3
  90. package/modules/esnext.array.with.js +2 -3
  91. package/modules/esnext.async-iterator.reduce.js +2 -3
  92. package/modules/esnext.composite-key.js +2 -3
  93. package/modules/esnext.iterator.flat-map.js +2 -3
  94. package/modules/esnext.iterator.reduce.js +2 -3
  95. package/modules/esnext.map.reduce.js +2 -3
  96. package/modules/esnext.map.update.js +2 -3
  97. package/modules/esnext.math.seeded-prng.js +2 -3
  98. package/modules/esnext.math.signbit.js +3 -1
  99. package/modules/esnext.number.from-string.js +8 -9
  100. package/modules/esnext.set.reduce.js +2 -3
  101. package/modules/esnext.string.cooked.js +2 -3
  102. package/modules/esnext.typed-array.with.js +9 -0
  103. package/modules/web.queue-microtask.js +1 -1
  104. package/modules/web.url-search-params.constructor.js +2 -2
  105. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- var parent = require('../../stable/typed-array/every');
1
+ var parent = require('../../stable/typed-array/at');
2
2
 
3
3
  module.exports = parent;
@@ -1,4 +1,4 @@
1
- var parent = require('../../actual/typed-array/every');
1
+ var parent = require('../../actual/typed-array/at');
2
2
 
3
3
  // TODO: Remove from `core-js@4`
4
4
  require('../../modules/esnext.typed-array.at');
@@ -1,11 +1,10 @@
1
- var global = require('../internals/global');
2
1
  var isCallable = require('../internals/is-callable');
3
2
  var tryToString = require('../internals/try-to-string');
4
3
 
5
- var TypeError = global.TypeError;
4
+ var $TypeError = TypeError;
6
5
 
7
6
  // `Assert: IsCallable(argument) is true`
8
7
  module.exports = function (argument) {
9
8
  if (isCallable(argument)) return argument;
10
- throw TypeError(tryToString(argument) + ' is not a function');
9
+ throw $TypeError(tryToString(argument) + ' is not a function');
11
10
  };
@@ -1,11 +1,10 @@
1
- var global = require('../internals/global');
2
1
  var isConstructor = require('../internals/is-constructor');
3
2
  var tryToString = require('../internals/try-to-string');
4
3
 
5
- var TypeError = global.TypeError;
4
+ var $TypeError = TypeError;
6
5
 
7
6
  // `Assert: IsConstructor(argument) is true`
8
7
  module.exports = function (argument) {
9
8
  if (isConstructor(argument)) return argument;
10
- throw TypeError(tryToString(argument) + ' is not a constructor');
9
+ throw $TypeError(tryToString(argument) + ' is not a constructor');
11
10
  };
@@ -1,10 +1,9 @@
1
- var global = require('../internals/global');
2
1
  var isCallable = require('../internals/is-callable');
3
2
 
4
- var String = global.String;
5
- var TypeError = global.TypeError;
3
+ var $String = String;
4
+ var $TypeError = TypeError;
6
5
 
7
6
  module.exports = function (argument) {
8
7
  if (typeof argument == 'object' || isCallable(argument)) return argument;
9
- throw TypeError("Can't set " + String(argument) + ' as a prototype');
8
+ throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
10
9
  };
@@ -1,6 +1,6 @@
1
1
  var wellKnownSymbol = require('../internals/well-known-symbol');
2
2
  var create = require('../internals/object-create');
3
- var definePropertyModule = require('../internals/object-define-property');
3
+ var defineProperty = require('../internals/object-define-property').f;
4
4
 
5
5
  var UNSCOPABLES = wellKnownSymbol('unscopables');
6
6
  var ArrayPrototype = Array.prototype;
@@ -8,7 +8,7 @@ var ArrayPrototype = Array.prototype;
8
8
  // Array.prototype[@@unscopables]
9
9
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
10
10
  if (ArrayPrototype[UNSCOPABLES] == undefined) {
11
- definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
11
+ defineProperty(ArrayPrototype, UNSCOPABLES, {
12
12
  configurable: true,
13
13
  value: create(null)
14
14
  });
@@ -1,9 +1,8 @@
1
- var global = require('../internals/global');
2
1
  var isPrototypeOf = require('../internals/object-is-prototype-of');
3
2
 
4
- var TypeError = global.TypeError;
3
+ var $TypeError = TypeError;
5
4
 
6
5
  module.exports = function (it, Prototype) {
7
6
  if (isPrototypeOf(Prototype, it)) return it;
8
- throw TypeError('Incorrect invocation');
7
+ throw $TypeError('Incorrect invocation');
9
8
  };
@@ -1,11 +1,10 @@
1
- var global = require('../internals/global');
2
1
  var isObject = require('../internals/is-object');
3
2
 
4
- var String = global.String;
5
- var TypeError = global.TypeError;
3
+ var $String = String;
4
+ var $TypeError = TypeError;
6
5
 
7
6
  // `Assert: Type(argument) is Object`
8
7
  module.exports = function (argument) {
9
8
  if (isObject(argument)) return argument;
10
- throw TypeError(String(argument) + ' is not an object');
9
+ throw $TypeError($String(argument) + ' is not an object');
11
10
  };
@@ -2,6 +2,7 @@
2
2
  var toObject = require('../internals/to-object');
3
3
  var toAbsoluteIndex = require('../internals/to-absolute-index');
4
4
  var lengthOfArrayLike = require('../internals/length-of-array-like');
5
+ var deletePropertyOrThrow = require('../internals/delete-property-or-throw');
5
6
 
6
7
  var min = Math.min;
7
8
 
@@ -23,7 +24,7 @@ module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /*
23
24
  }
24
25
  while (count-- > 0) {
25
26
  if (from in O) O[to] = O[from];
26
- else delete O[to];
27
+ else deletePropertyOrThrow(O, to);
27
28
  to += inc;
28
29
  from += inc;
29
30
  } return O;
@@ -1,5 +1,4 @@
1
1
  'use strict';
2
- var global = require('../internals/global');
3
2
  var bind = require('../internals/function-bind-context');
4
3
  var call = require('../internals/function-call');
5
4
  var toObject = require('../internals/to-object');
@@ -11,7 +10,7 @@ var createProperty = require('../internals/create-property');
11
10
  var getIterator = require('../internals/get-iterator');
12
11
  var getIteratorMethod = require('../internals/get-iterator-method');
13
12
 
14
- var Array = global.Array;
13
+ var $Array = Array;
15
14
 
16
15
  // `Array.from` method implementation
17
16
  // https://tc39.es/ecma262/#sec-array.from
@@ -26,7 +25,7 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
26
25
  var index = 0;
27
26
  var length, result, step, iterator, next, value;
28
27
  // if the target is not iterable or it's an array with the default iterator - use a simple case
29
- if (iteratorMethod && !(this == Array && isArrayIteratorMethod(iteratorMethod))) {
28
+ if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
30
29
  iterator = getIterator(O, iteratorMethod);
31
30
  next = iterator.next;
32
31
  result = IS_CONSTRUCTOR ? new this() : [];
@@ -36,7 +35,7 @@ module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undef
36
35
  }
37
36
  } else {
38
37
  length = lengthOfArrayLike(O);
39
- result = IS_CONSTRUCTOR ? new this(length) : Array(length);
38
+ result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
40
39
  for (;length > index; index++) {
41
40
  value = mapping ? mapfn(O[index], index) : O[index];
42
41
  createProperty(result, index, value);
@@ -1,4 +1,3 @@
1
- var global = require('../internals/global');
2
1
  var bind = require('../internals/function-bind-context');
3
2
  var uncurryThis = require('../internals/function-uncurry-this');
4
3
  var IndexedObject = require('../internals/indexed-object');
@@ -8,7 +7,7 @@ var lengthOfArrayLike = require('../internals/length-of-array-like');
8
7
  var objectCreate = require('../internals/object-create');
9
8
  var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
10
9
 
11
- var Array = global.Array;
10
+ var $Array = Array;
12
11
  var push = uncurryThis([].push);
13
12
 
14
13
  module.exports = function ($this, callbackfn, that, specificConstructor) {
@@ -30,7 +29,7 @@ module.exports = function ($this, callbackfn, that, specificConstructor) {
30
29
  // TODO: Remove this block from `core-js@4`
31
30
  if (specificConstructor) {
32
31
  Constructor = specificConstructor(O);
33
- if (Constructor !== Array) {
32
+ if (Constructor !== $Array) {
34
33
  for (key in target) target[key] = arrayFromConstructorAndList(Constructor, target[key]);
35
34
  }
36
35
  } return target;
@@ -1,10 +1,9 @@
1
- var global = require('../internals/global');
2
1
  var aCallable = require('../internals/a-callable');
3
2
  var toObject = require('../internals/to-object');
4
3
  var IndexedObject = require('../internals/indexed-object');
5
4
  var lengthOfArrayLike = require('../internals/length-of-array-like');
6
5
 
7
- var TypeError = global.TypeError;
6
+ var $TypeError = TypeError;
8
7
 
9
8
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
10
9
  var createMethod = function (IS_RIGHT) {
@@ -23,7 +22,7 @@ var createMethod = function (IS_RIGHT) {
23
22
  }
24
23
  index += i;
25
24
  if (IS_RIGHT ? index < 0 : length <= index) {
26
- throw TypeError('Reduce of empty array with no initial value');
25
+ throw $TypeError('Reduce of empty array with no initial value');
27
26
  }
28
27
  }
29
28
  for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
@@ -1,16 +1,15 @@
1
- var global = require('../internals/global');
2
1
  var toAbsoluteIndex = require('../internals/to-absolute-index');
3
2
  var lengthOfArrayLike = require('../internals/length-of-array-like');
4
3
  var createProperty = require('../internals/create-property');
5
4
 
6
- var Array = global.Array;
5
+ var $Array = Array;
7
6
  var max = Math.max;
8
7
 
9
8
  module.exports = function (O, start, end) {
10
9
  var length = lengthOfArrayLike(O);
11
10
  var k = toAbsoluteIndex(start, length);
12
11
  var fin = toAbsoluteIndex(end === undefined ? length : end, length);
13
- var result = Array(max(fin - k, 0));
12
+ var result = $Array(max(fin - k, 0));
14
13
  for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
15
14
  result.length = n;
16
15
  return result;
@@ -1,11 +1,10 @@
1
- var global = require('../internals/global');
2
1
  var isArray = require('../internals/is-array');
3
2
  var isConstructor = require('../internals/is-constructor');
4
3
  var isObject = require('../internals/is-object');
5
4
  var wellKnownSymbol = require('../internals/well-known-symbol');
6
5
 
7
6
  var SPECIES = wellKnownSymbol('species');
8
- var Array = global.Array;
7
+ var $Array = Array;
9
8
 
10
9
  // a part of `ArraySpeciesCreate` abstract operation
11
10
  // https://tc39.es/ecma262/#sec-arrayspeciescreate
@@ -14,10 +13,10 @@ module.exports = function (originalArray) {
14
13
  if (isArray(originalArray)) {
15
14
  C = originalArray.constructor;
16
15
  // cross-realm fallback
17
- if (isConstructor(C) && (C === Array || isArray(C.prototype))) C = undefined;
16
+ if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
18
17
  else if (isObject(C)) {
19
18
  C = C[SPECIES];
20
19
  if (C === null) C = undefined;
21
20
  }
22
- } return C === undefined ? Array : C;
21
+ } return C === undefined ? $Array : C;
23
22
  };
@@ -1,11 +1,10 @@
1
1
  var lengthOfArrayLike = require('../internals/length-of-array-like');
2
+ var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');
2
3
  var toAbsoluteIndex = require('../internals/to-absolute-index');
3
4
  var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
4
5
 
5
- var $TypeError = TypeError;
6
6
  var max = Math.max;
7
7
  var min = Math.min;
8
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
9
8
 
10
9
  // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSpliced
11
10
  // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSpliced
@@ -26,8 +25,7 @@ module.exports = function (O, C, args) {
26
25
  insertCount = argumentsLength - 2;
27
26
  actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
28
27
  }
29
- newLen = len + insertCount - actualDeleteCount;
30
- if (newLen > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed length exceeded');
28
+ newLen = doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
31
29
  A = new C(newLen);
32
30
 
33
31
  for (; k < actualStart; k++) A[k] = O[k];
@@ -1,8 +1,7 @@
1
- var global = require('../internals/global');
2
1
  var lengthOfArrayLike = require('../internals/length-of-array-like');
3
2
  var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
4
3
 
5
- var RangeError = global.RangeError;
4
+ var $RangeError = RangeError;
6
5
 
7
6
  // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with
8
7
  // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with
@@ -10,7 +9,7 @@ module.exports = function (O, C, index, value) {
10
9
  var len = lengthOfArrayLike(O);
11
10
  var relativeIndex = toIntegerOrInfinity(index);
12
11
  var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex;
13
- if (actualIndex >= len || actualIndex < 0) throw RangeError('Incorrect index');
12
+ if (actualIndex >= len || actualIndex < 0) throw $RangeError('Incorrect index');
14
13
  var A = new C(len);
15
14
  var k = 0;
16
15
  for (; k < len; k++) A[k] = k === actualIndex ? value : O[k];
@@ -1,16 +1,13 @@
1
1
  'use strict';
2
2
  // https://github.com/tc39/proposal-iterator-helpers
3
3
  // https://github.com/tc39/proposal-array-from-async
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');
7
+ var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');
8
8
  var getBuiltIn = require('../internals/get-built-in');
9
9
  var getMethod = require('../internals/get-method');
10
10
 
11
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
12
- var TypeError = global.TypeError;
13
-
14
11
  var createMethod = function (TYPE) {
15
12
  var IS_TO_ARRAY = TYPE == 0;
16
13
  var IS_FOR_EACH = TYPE == 1;
@@ -46,9 +43,7 @@ var createMethod = function (TYPE) {
46
43
 
47
44
  var loop = function () {
48
45
  try {
49
- if (IS_TO_ARRAY && (index > MAX_SAFE_INTEGER) && MAPPING) {
50
- throw TypeError('The allowed number of iterations has been exceeded');
51
- }
46
+ if (IS_TO_ARRAY && MAPPING) doesNotExceedSafeInteger(index);
52
47
  Promise.resolve(anObject(call(next, iterator))).then(function (step) {
53
48
  try {
54
49
  if (anObject(step).done) {
@@ -1,11 +1,10 @@
1
- var global = require('../internals/global');
2
1
  var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');
3
2
  var isCallable = require('../internals/is-callable');
4
3
  var classofRaw = require('../internals/classof-raw');
5
4
  var wellKnownSymbol = require('../internals/well-known-symbol');
6
5
 
7
6
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
8
- var Object = global.Object;
7
+ var $Object = Object;
9
8
 
10
9
  // ES3 wrong here
11
10
  var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
@@ -22,7 +21,7 @@ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
22
21
  var O, tag, result;
23
22
  return it === undefined ? 'Undefined' : it === null ? 'Null'
24
23
  // @@toStringTag case
25
- : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
24
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
26
25
  // builtinTag case
27
26
  : CORRECT_ARGUMENTS ? classofRaw(O)
28
27
  // ES3 arguments fallback
@@ -1,13 +1,12 @@
1
1
  // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
2
2
  require('../modules/es.map');
3
3
  require('../modules/es.weak-map');
4
- var global = require('../internals/global');
5
4
  var getBuiltIn = require('../internals/get-built-in');
6
5
  var create = require('../internals/object-create');
7
6
  var isObject = require('../internals/is-object');
8
7
 
9
- var Object = global.Object;
10
- var TypeError = global.TypeError;
8
+ var $Object = Object;
9
+ var $TypeError = TypeError;
11
10
  var Map = getBuiltIn('Map');
12
11
  var WeakMap = getBuiltIn('WeakMap');
13
12
 
@@ -43,7 +42,7 @@ module.exports = function () {
43
42
  for (i = 0; i < length; i++) {
44
43
  if (isObject(it = arguments[i])) active = active.next(i, it, true);
45
44
  }
46
- if (this === Object && active === root) throw TypeError('Composite keys must contain a non-primitive component');
45
+ if (this === $Object && active === root) throw $TypeError('Composite keys must contain a non-primitive component');
47
46
  for (i = 0; i < length; i++) {
48
47
  if (!isObject(it = arguments[i])) active = active.next(i, it, false);
49
48
  } return active;
@@ -1,10 +1,9 @@
1
1
  'use strict';
2
- var global = require('../internals/global');
3
2
  var uncurryThis = require('../internals/function-uncurry-this');
4
3
  var fails = require('../internals/fails');
5
4
  var padStart = require('../internals/string-pad').start;
6
5
 
7
- var RangeError = global.RangeError;
6
+ var $RangeError = RangeError;
8
7
  var abs = Math.abs;
9
8
  var DatePrototype = Date.prototype;
10
9
  var n$DateToISOString = DatePrototype.toISOString;
@@ -25,7 +24,7 @@ module.exports = (fails(function () {
25
24
  }) || !fails(function () {
26
25
  n$DateToISOString.call(new Date(NaN));
27
26
  })) ? function toISOString() {
28
- if (!isFinite(getTime(this))) throw RangeError('Invalid time value');
27
+ if (!isFinite(getTime(this))) throw $RangeError('Invalid time value');
29
28
  var date = this;
30
29
  var year = getUTCFullYear(date);
31
30
  var milliseconds = getUTCMilliseconds(date);
@@ -1,15 +1,14 @@
1
1
  'use strict';
2
- var global = require('../internals/global');
3
2
  var anObject = require('../internals/an-object');
4
3
  var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
5
4
 
6
- var TypeError = global.TypeError;
5
+ var $TypeError = TypeError;
7
6
 
8
7
  // `Date.prototype[@@toPrimitive](hint)` method implementation
9
8
  // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
10
9
  module.exports = function (hint) {
11
10
  anObject(this);
12
11
  if (hint === 'string' || hint === 'default') hint = 'string';
13
- else if (hint !== 'number') throw TypeError('Incorrect hint');
12
+ else if (hint !== 'number') throw $TypeError('Incorrect hint');
14
13
  return ordinaryToPrimitive(this, hint);
15
14
  };
@@ -1,25 +1,20 @@
1
- var global = require('../internals/global');
2
1
  var isCallable = require('../internals/is-callable');
3
2
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
4
3
  var makeBuiltIn = require('../internals/make-built-in');
5
- var setGlobal = require('../internals/set-global');
4
+ var defineGlobalProperty = require('../internals/define-global-property');
6
5
 
7
6
  module.exports = function (O, key, value, options) {
8
- var unsafe = options ? !!options.unsafe : false;
9
- var simple = options ? !!options.enumerable : false;
10
- var noTargetGet = options ? !!options.noTargetGet : false;
11
- var name = options && options.name !== undefined ? options.name : key;
7
+ if (!options) options = {};
8
+ var simple = options.enumerable;
9
+ var name = options.name !== undefined ? options.name : key;
12
10
  if (isCallable(value)) makeBuiltIn(value, name, options);
13
- if (O === global) {
11
+ if (options.global) {
14
12
  if (simple) O[key] = value;
15
- else setGlobal(key, value);
16
- return O;
17
- } else if (!unsafe) {
18
- delete O[key];
19
- } else if (!noTargetGet && O[key]) {
20
- simple = true;
21
- }
22
- if (simple) O[key] = value;
23
- else createNonEnumerableProperty(O, key, value);
24
- return O;
13
+ else defineGlobalProperty(key, value);
14
+ } else {
15
+ if (!options.unsafe) delete O[key];
16
+ else if (O[key]) simple = true;
17
+ if (simple) O[key] = value;
18
+ else createNonEnumerableProperty(O, key, value);
19
+ } return O;
25
20
  };
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+ var tryToString = require('../internals/try-to-string');
3
+
4
+ var $TypeError = TypeError;
5
+
6
+ module.exports = function (O, P) {
7
+ if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
8
+ };
@@ -0,0 +1,7 @@
1
+ var $TypeError = TypeError;
2
+ var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
3
+
4
+ module.exports = function (it) {
5
+ if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
6
+ return it;
7
+ };
@@ -2,24 +2,24 @@ var global = require('../internals/global');
2
2
  var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
3
3
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
4
4
  var defineBuiltIn = require('../internals/define-built-in');
5
- var setGlobal = require('../internals/set-global');
5
+ var defineGlobalProperty = require('../internals/define-global-property');
6
6
  var copyConstructorProperties = require('../internals/copy-constructor-properties');
7
7
  var isForced = require('../internals/is-forced');
8
8
 
9
9
  /*
10
- options.target - name of the target object
11
- options.global - target is the global object
12
- options.stat - export as static methods of target
13
- options.proto - export as prototype methods of target
14
- options.real - real prototype method for the `pure` version
15
- options.forced - export even if the native feature is available
16
- options.bind - bind methods to the target, required for the `pure` version
17
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
18
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
19
- options.sham - add a flag to not completely full polyfills
20
- options.enumerable - export as enumerable property
21
- options.noTargetGet - prevent calling a getter on target
22
- options.name - the .name of the function if it does not match the key
10
+ options.target - name of the target object
11
+ options.global - target is the global object
12
+ options.stat - export as static methods of target
13
+ options.proto - export as prototype methods of target
14
+ options.real - real prototype method for the `pure` version
15
+ options.forced - export even if the native feature is available
16
+ options.bind - bind methods to the target, required for the `pure` version
17
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
18
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
19
+ options.sham - add a flag to not completely full polyfills
20
+ options.enumerable - export as enumerable property
21
+ options.dontCallGetSet - prevent calling a getter on target
22
+ options.name - the .name of the function if it does not match the key
23
23
  */
24
24
  module.exports = function (options, source) {
25
25
  var TARGET = options.target;
@@ -29,13 +29,13 @@ module.exports = function (options, source) {
29
29
  if (GLOBAL) {
30
30
  target = global;
31
31
  } else if (STATIC) {
32
- target = global[TARGET] || setGlobal(TARGET, {});
32
+ target = global[TARGET] || defineGlobalProperty(TARGET, {});
33
33
  } else {
34
34
  target = (global[TARGET] || {}).prototype;
35
35
  }
36
36
  if (target) for (key in source) {
37
37
  sourceProperty = source[key];
38
- if (options.noTargetGet) {
38
+ if (options.dontCallGetSet) {
39
39
  descriptor = getOwnPropertyDescriptor(target, key);
40
40
  targetProperty = descriptor && descriptor.value;
41
41
  } else targetProperty = target[key];
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
- var global = require('../internals/global');
3
2
  var isArray = require('../internals/is-array');
4
3
  var lengthOfArrayLike = require('../internals/length-of-array-like');
4
+ var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');
5
5
  var bind = require('../internals/function-bind-context');
6
6
 
7
- var TypeError = global.TypeError;
8
-
9
7
  // `FlattenIntoArray` abstract operation
10
8
  // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
11
9
  var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
@@ -22,7 +20,7 @@ var flattenIntoArray = function (target, original, source, sourceLen, start, dep
22
20
  elementLen = lengthOfArrayLike(element);
23
21
  targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
24
22
  } else {
25
- if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
23
+ doesNotExceedSafeInteger(targetIndex + 1);
26
24
  target[targetIndex] = element;
27
25
  }
28
26
 
@@ -1,5 +1,4 @@
1
1
  'use strict';
2
- var global = require('../internals/global');
3
2
  var uncurryThis = require('../internals/function-uncurry-this');
4
3
  var aCallable = require('../internals/a-callable');
5
4
  var isObject = require('../internals/is-object');
@@ -7,7 +6,7 @@ var hasOwn = require('../internals/has-own-property');
7
6
  var arraySlice = require('../internals/array-slice');
8
7
  var NATIVE_BIND = require('../internals/function-bind-native');
9
8
 
10
- var Function = global.Function;
9
+ var $Function = Function;
11
10
  var concat = uncurryThis([].concat);
12
11
  var join = uncurryThis([].join);
13
12
  var factories = {};
@@ -15,13 +14,13 @@ var factories = {};
15
14
  var construct = function (C, argsLength, args) {
16
15
  if (!hasOwn(factories, argsLength)) {
17
16
  for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
18
- factories[argsLength] = Function('C,a', 'return new C(' + join(list, ',') + ')');
17
+ factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
19
18
  } return factories[argsLength](C, args);
20
19
  };
21
20
 
22
21
  // `Function.prototype.bind` method implementation
23
22
  // https://tc39.es/ecma262/#sec-function.prototype.bind
24
- module.exports = NATIVE_BIND ? Function.bind : function bind(that /* , ...args */) {
23
+ module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
25
24
  var F = aCallable(this);
26
25
  var Prototype = F.prototype;
27
26
  var partArgs = arraySlice(arguments, 1);
@@ -1,14 +1,13 @@
1
- var global = require('../internals/global');
2
1
  var call = require('../internals/function-call');
3
2
  var aCallable = require('../internals/a-callable');
4
3
  var anObject = require('../internals/an-object');
5
4
  var tryToString = require('../internals/try-to-string');
6
5
  var getIteratorMethod = require('../internals/get-iterator-method');
7
6
 
8
- var TypeError = global.TypeError;
7
+ var $TypeError = TypeError;
9
8
 
10
9
  module.exports = function (argument, usingIterator) {
11
10
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
12
11
  if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
13
- throw TypeError(tryToString(argument) + ' is not iterable');
12
+ throw $TypeError(tryToString(argument) + ' is not iterable');
14
13
  };
@@ -1,7 +1,5 @@
1
1
  // IEEE754 conversions based on https://github.com/feross/ieee754
2
- var global = require('../internals/global');
3
-
4
- var Array = global.Array;
2
+ var $Array = Array;
5
3
  var abs = Math.abs;
6
4
  var pow = Math.pow;
7
5
  var floor = Math.floor;
@@ -9,7 +7,7 @@ var log = Math.log;
9
7
  var LN2 = Math.LN2;
10
8
 
11
9
  var pack = function (number, mantissaLength, bytes) {
12
- var buffer = Array(bytes);
10
+ var buffer = $Array(bytes);
13
11
  var exponentLength = bytes * 8 - mantissaLength - 1;
14
12
  var eMax = (1 << exponentLength) - 1;
15
13
  var eBias = eMax >> 1;
@@ -1,16 +1,15 @@
1
- var global = require('../internals/global');
2
1
  var uncurryThis = require('../internals/function-uncurry-this');
3
2
  var fails = require('../internals/fails');
4
3
  var classof = require('../internals/classof-raw');
5
4
 
6
- var Object = global.Object;
5
+ var $Object = Object;
7
6
  var split = uncurryThis(''.split);
8
7
 
9
8
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
10
9
  module.exports = fails(function () {
11
10
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
12
11
  // eslint-disable-next-line no-prototype-builtins -- safe
13
- return !Object('z').propertyIsEnumerable(0);
12
+ return !$Object('z').propertyIsEnumerable(0);
14
13
  }) ? function (it) {
15
- return classof(it) == 'String' ? split(it, '') : Object(it);
16
- } : Object;
14
+ return classof(it) == 'String' ? split(it, '') : $Object(it);
15
+ } : $Object;