core-js 3.32.2 → 3.33.1

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 (198) hide show
  1. package/actual/array/virtual/group-by-to-map.js +2 -2
  2. package/actual/array/virtual/group-by.js +2 -2
  3. package/actual/array/virtual/group-to-map.js +2 -2
  4. package/actual/array/virtual/group.js +2 -2
  5. package/es/README.md +1 -1
  6. package/es/array/virtual/at.js +2 -2
  7. package/es/array/virtual/concat.js +2 -2
  8. package/es/array/virtual/copy-within.js +2 -2
  9. package/es/array/virtual/entries.js +2 -2
  10. package/es/array/virtual/every.js +2 -2
  11. package/es/array/virtual/fill.js +2 -2
  12. package/es/array/virtual/filter.js +2 -2
  13. package/es/array/virtual/find-index.js +2 -2
  14. package/es/array/virtual/find-last-index.js +2 -2
  15. package/es/array/virtual/find-last.js +2 -2
  16. package/es/array/virtual/find.js +2 -2
  17. package/es/array/virtual/flat-map.js +2 -2
  18. package/es/array/virtual/flat.js +2 -2
  19. package/es/array/virtual/for-each.js +2 -2
  20. package/es/array/virtual/includes.js +2 -2
  21. package/es/array/virtual/index-of.js +2 -2
  22. package/es/array/virtual/iterator.js +2 -2
  23. package/es/array/virtual/join.js +2 -2
  24. package/es/array/virtual/keys.js +2 -2
  25. package/es/array/virtual/last-index-of.js +2 -2
  26. package/es/array/virtual/map.js +2 -2
  27. package/es/array/virtual/push.js +2 -2
  28. package/es/array/virtual/reduce-right.js +2 -2
  29. package/es/array/virtual/reduce.js +2 -2
  30. package/es/array/virtual/reverse.js +2 -2
  31. package/es/array/virtual/slice.js +2 -2
  32. package/es/array/virtual/some.js +2 -2
  33. package/es/array/virtual/sort.js +2 -2
  34. package/es/array/virtual/splice.js +2 -2
  35. package/es/array/virtual/to-reversed.js +2 -2
  36. package/es/array/virtual/to-sorted.js +2 -2
  37. package/es/array/virtual/to-spliced.js +2 -2
  38. package/es/array/virtual/unshift.js +2 -2
  39. package/es/array/virtual/values.js +2 -2
  40. package/es/array/virtual/with.js +2 -2
  41. package/es/function/virtual/bind.js +2 -2
  42. package/es/number/virtual/to-exponential.js +2 -2
  43. package/es/number/virtual/to-fixed.js +2 -2
  44. package/es/number/virtual/to-precision.js +2 -2
  45. package/es/string/virtual/anchor.js +2 -2
  46. package/es/string/virtual/at.js +2 -2
  47. package/es/string/virtual/big.js +2 -2
  48. package/es/string/virtual/blink.js +2 -2
  49. package/es/string/virtual/bold.js +2 -2
  50. package/es/string/virtual/code-point-at.js +2 -2
  51. package/es/string/virtual/ends-with.js +2 -2
  52. package/es/string/virtual/fixed.js +2 -2
  53. package/es/string/virtual/fontcolor.js +2 -2
  54. package/es/string/virtual/fontsize.js +2 -2
  55. package/es/string/virtual/includes.js +2 -2
  56. package/es/string/virtual/is-well-formed.js +2 -1
  57. package/es/string/virtual/italics.js +2 -2
  58. package/es/string/virtual/link.js +2 -2
  59. package/es/string/virtual/match-all.js +2 -2
  60. package/es/string/virtual/pad-end.js +2 -2
  61. package/es/string/virtual/pad-start.js +2 -2
  62. package/es/string/virtual/repeat.js +2 -2
  63. package/es/string/virtual/replace-all.js +2 -2
  64. package/es/string/virtual/small.js +2 -2
  65. package/es/string/virtual/starts-with.js +2 -2
  66. package/es/string/virtual/strike.js +2 -2
  67. package/es/string/virtual/sub.js +2 -2
  68. package/es/string/virtual/substr.js +2 -2
  69. package/es/string/virtual/sup.js +2 -2
  70. package/es/string/virtual/to-well-formed.js +2 -1
  71. package/es/string/virtual/trim-end.js +2 -2
  72. package/es/string/virtual/trim-left.js +2 -2
  73. package/es/string/virtual/trim-right.js +2 -2
  74. package/es/string/virtual/trim-start.js +2 -2
  75. package/es/string/virtual/trim.js +2 -2
  76. package/features/regexp/escape.js +2 -0
  77. package/full/array/virtual/filter-out.js +2 -2
  78. package/full/array/virtual/filter-reject.js +2 -2
  79. package/full/array/virtual/unique-by.js +2 -2
  80. package/full/function/virtual/demethodize.js +2 -2
  81. package/full/function/virtual/un-this.js +2 -2
  82. package/full/index.js +1 -0
  83. package/full/regexp/escape.js +5 -0
  84. package/full/regexp/index.js +1 -0
  85. package/full/string/virtual/at.js +2 -2
  86. package/full/string/virtual/code-points.js +2 -1
  87. package/internals/a-callable.js +1 -1
  88. package/internals/a-constructor.js +1 -1
  89. package/internals/a-possible-prototype.js +1 -1
  90. package/internals/an-instance.js +1 -1
  91. package/internals/an-object.js +1 -1
  92. package/internals/array-buffer-byte-length.js +1 -1
  93. package/internals/array-buffer-transfer.js +22 -14
  94. package/internals/array-buffer-view-core.js +3 -3
  95. package/internals/array-buffer.js +6 -5
  96. package/internals/array-from-async.js +2 -2
  97. package/internals/array-reduce.js +1 -1
  98. package/internals/array-set-length.js +1 -1
  99. package/internals/array-with.js +1 -1
  100. package/internals/composite-key.js +1 -1
  101. package/internals/date-to-iso-string.js +1 -1
  102. package/internals/date-to-primitive.js +1 -1
  103. package/internals/delete-property-or-throw.js +1 -1
  104. package/internals/detach-transferable.js +37 -0
  105. package/internals/error-stack-clear.js +1 -1
  106. package/internals/error-stack-installable.js +1 -1
  107. package/internals/error-to-string.js +2 -3
  108. package/internals/get-built-in-prototype-method.js +6 -0
  109. package/internals/get-iterator.js +1 -1
  110. package/internals/get-set-record.js +2 -2
  111. package/internals/ieee754.js +9 -20
  112. package/internals/internal-state.js +3 -3
  113. package/internals/is-constructor.js +1 -1
  114. package/internals/iterate.js +1 -1
  115. package/internals/map-upsert.js +1 -1
  116. package/internals/math-f16round.js +12 -0
  117. package/internals/math-float-round.js +23 -0
  118. package/internals/math-fround.js +5 -21
  119. package/internals/new-promise-capability.js +1 -1
  120. package/internals/not-a-nan.js +1 -1
  121. package/internals/not-a-regexp.js +1 -1
  122. package/internals/numeric-range-iterator.js +5 -5
  123. package/internals/object-define-property.js +1 -1
  124. package/internals/ordinary-to-primitive.js +1 -1
  125. package/internals/parse-json-string.js +4 -4
  126. package/internals/regexp-exec-abstract.js +1 -1
  127. package/internals/regexp-unsupported-dot-all.js +1 -1
  128. package/internals/require-object-coercible.js +1 -1
  129. package/internals/shared.js +2 -2
  130. package/internals/string-cooked.js +1 -1
  131. package/internals/string-punycode-to-ascii.js +2 -2
  132. package/internals/string-repeat.js +1 -1
  133. package/internals/to-big-int.js +1 -1
  134. package/internals/to-index.js +1 -1
  135. package/internals/to-offset.js +1 -1
  136. package/internals/to-positive-integer.js +1 -1
  137. package/internals/to-primitive.js +1 -1
  138. package/internals/to-string.js +1 -1
  139. package/internals/typed-array-constructor.js +3 -3
  140. package/internals/validate-arguments-length.js +1 -1
  141. package/modules/es.aggregate-error.constructor.js +1 -1
  142. package/modules/es.array.iterator.js +1 -2
  143. package/modules/es.array.to-sorted.js +2 -2
  144. package/modules/es.error.cause.js +2 -1
  145. package/modules/es.number.constructor.js +1 -1
  146. package/modules/es.number.to-exponential.js +1 -1
  147. package/modules/es.number.to-fixed.js +1 -1
  148. package/modules/es.promise.constructor.js +2 -2
  149. package/modules/es.regexp.dot-all.js +1 -1
  150. package/modules/es.regexp.sticky.js +1 -1
  151. package/modules/es.string.from-code-point.js +1 -1
  152. package/modules/es.string.match-all.js +1 -1
  153. package/modules/es.string.replace-all.js +1 -1
  154. package/modules/es.symbol.constructor.js +20 -10
  155. package/modules/es.symbol.key-for.js +1 -1
  156. package/modules/es.typed-array.set.js +1 -1
  157. package/modules/esnext.async-disposable-stack.constructor.js +1 -1
  158. package/modules/esnext.async-iterator.constructor.js +1 -1
  159. package/modules/esnext.async-iterator.reduce.js +1 -1
  160. package/modules/esnext.data-view.get-uint8-clamped.js +1 -1
  161. package/modules/esnext.data-view.set-float16.js +3 -2
  162. package/modules/esnext.data-view.set-uint8-clamped.js +2 -2
  163. package/modules/esnext.disposable-stack.constructor.js +1 -1
  164. package/modules/esnext.iterator.constructor.js +1 -1
  165. package/modules/esnext.iterator.range.js +1 -1
  166. package/modules/esnext.iterator.reduce.js +1 -1
  167. package/modules/esnext.json.parse.js +6 -6
  168. package/modules/esnext.json.raw-json.js +2 -2
  169. package/modules/esnext.map.reduce.js +1 -1
  170. package/modules/esnext.map.update.js +1 -1
  171. package/modules/esnext.math.f16round.js +2 -11
  172. package/modules/esnext.math.seeded-prng.js +1 -1
  173. package/modules/esnext.number.from-string.js +5 -5
  174. package/modules/esnext.observable.constructor.js +1 -2
  175. package/modules/esnext.observable.from.js +1 -2
  176. package/modules/esnext.observable.of.js +1 -2
  177. package/modules/esnext.regexp.escape.js +20 -0
  178. package/modules/esnext.set.reduce.js +1 -1
  179. package/modules/esnext.string.dedent.js +5 -5
  180. package/modules/esnext.suppressed-error.constructor.js +1 -1
  181. package/modules/esnext.symbol.metadata-key.js +1 -0
  182. package/modules/esnext.symbol.metadata.js +0 -1
  183. package/modules/web.dom-exception.constructor.js +2 -2
  184. package/modules/web.dom-exception.stack.js +2 -2
  185. package/modules/web.self.js +1 -1
  186. package/modules/web.structured-clone.js +18 -17
  187. package/modules/web.url-search-params.constructor.js +21 -12
  188. package/modules/web.url.constructor.js +3 -3
  189. package/package.json +2 -1
  190. package/postinstall.js +1 -0
  191. package/proposals/array-buffer-transfer.js +1 -0
  192. package/proposals/data-view-get-set-uint8-clamped.js +1 -1
  193. package/proposals/regexp-escaping.js +3 -0
  194. package/stable/instance/for-each.js +1 -1
  195. package/stage/2.js +1 -0
  196. package/stage/README.md +1 -1
  197. package/web/README.md +1 -1
  198. package/internals/observable-forced.js +0 -14
@@ -1,8 +1,5 @@
1
1
  'use strict';
2
2
  // IEEE754 conversions based on https://github.com/feross/ieee754
3
- var sign = require('../internals/math-sign');
4
- var trunc = require('../internals/math-trunc');
5
-
6
3
  var $Array = Array;
7
4
  var abs = Math.abs;
8
5
  var pow = Math.pow;
@@ -10,21 +7,13 @@ var floor = Math.floor;
10
7
  var log = Math.log;
11
8
  var LN2 = Math.LN2;
12
9
 
13
- var roundToEven = function (number) {
14
- var truncated = trunc(number);
15
- var delta = abs(number - truncated);
16
- if (delta > 0.5 || delta === 0.5 && truncated % 2 !== 0) {
17
- return truncated + sign(number);
18
- } return truncated;
19
- };
20
-
21
10
  var pack = function (number, mantissaLength, bytes) {
22
11
  var buffer = $Array(bytes);
23
12
  var exponentLength = bytes * 8 - mantissaLength - 1;
24
13
  var eMax = (1 << exponentLength) - 1;
25
14
  var eBias = eMax >> 1;
26
15
  var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
27
- var s = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
16
+ var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
28
17
  var index = 0;
29
18
  var exponent, mantissa, c;
30
19
  number = abs(number);
@@ -53,10 +42,10 @@ var pack = function (number, mantissaLength, bytes) {
53
42
  mantissa = 0;
54
43
  exponent = eMax;
55
44
  } else if (exponent + eBias >= 1) {
56
- mantissa = roundToEven((number * c - 1) * pow(2, mantissaLength));
45
+ mantissa = (number * c - 1) * pow(2, mantissaLength);
57
46
  exponent += eBias;
58
47
  } else {
59
- mantissa = roundToEven(number * pow(2, eBias - 1) * pow(2, mantissaLength));
48
+ mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
60
49
  exponent = 0;
61
50
  }
62
51
  }
@@ -72,7 +61,7 @@ var pack = function (number, mantissaLength, bytes) {
72
61
  exponent /= 256;
73
62
  exponentLength -= 8;
74
63
  }
75
- buffer[--index] |= s * 128;
64
+ buffer[--index] |= sign * 128;
76
65
  return buffer;
77
66
  };
78
67
 
@@ -83,10 +72,10 @@ var unpack = function (buffer, mantissaLength) {
83
72
  var eBias = eMax >> 1;
84
73
  var nBits = exponentLength - 7;
85
74
  var index = bytes - 1;
86
- var s = buffer[index--];
87
- var exponent = s & 127;
75
+ var sign = buffer[index--];
76
+ var exponent = sign & 127;
88
77
  var mantissa;
89
- s >>= 7;
78
+ sign >>= 7;
90
79
  while (nBits > 0) {
91
80
  exponent = exponent * 256 + buffer[index--];
92
81
  nBits -= 8;
@@ -101,11 +90,11 @@ var unpack = function (buffer, mantissaLength) {
101
90
  if (exponent === 0) {
102
91
  exponent = 1 - eBias;
103
92
  } else if (exponent === eMax) {
104
- return mantissa ? NaN : s ? -Infinity : Infinity;
93
+ return mantissa ? NaN : sign ? -Infinity : Infinity;
105
94
  } else {
106
95
  mantissa += pow(2, mantissaLength);
107
96
  exponent -= eBias;
108
- } return (s ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
97
+ } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
109
98
  };
110
99
 
111
100
  module.exports = {
@@ -21,7 +21,7 @@ var getterFor = function (TYPE) {
21
21
  return function (it) {
22
22
  var state;
23
23
  if (!isObject(it) || (state = get(it)).type !== TYPE) {
24
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
24
+ throw new TypeError('Incompatible receiver, ' + TYPE + ' required');
25
25
  } return state;
26
26
  };
27
27
  };
@@ -34,7 +34,7 @@ if (NATIVE_WEAK_MAP || shared.state) {
34
34
  store.set = store.set;
35
35
  /* eslint-enable no-self-assign -- prototype methods protection */
36
36
  set = function (it, metadata) {
37
- if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
37
+ if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
38
38
  metadata.facade = it;
39
39
  store.set(it, metadata);
40
40
  return metadata;
@@ -49,7 +49,7 @@ if (NATIVE_WEAK_MAP || shared.state) {
49
49
  var STATE = sharedKey('state');
50
50
  hiddenKeys[STATE] = true;
51
51
  set = function (it, metadata) {
52
- if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);
52
+ if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
53
53
  metadata.facade = it;
54
54
  createNonEnumerableProperty(it, STATE, metadata);
55
55
  return metadata;
@@ -11,7 +11,7 @@ var empty = [];
11
11
  var construct = getBuiltIn('Reflect', 'construct');
12
12
  var constructorRegExp = /^\s*(?:class|function)\b/;
13
13
  var exec = uncurryThis(constructorRegExp.exec);
14
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
14
+ var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
15
15
 
16
16
  var isConstructorModern = function isConstructor(argument) {
17
17
  if (!isCallable(argument)) return false;
@@ -46,7 +46,7 @@ module.exports = function (iterable, unboundFunction, options) {
46
46
  iterator = iterable;
47
47
  } else {
48
48
  iterFn = getIteratorMethod(iterable);
49
- if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
49
+ if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
50
50
  // optimisation for array iterators
51
51
  if (isArrayIteratorMethod(iterFn)) {
52
52
  for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
@@ -16,7 +16,7 @@ module.exports = function upsert(key, updateFn /* , insertFn */) {
16
16
  var insertFn = arguments.length > 2 ? arguments[2] : undefined;
17
17
  var value;
18
18
  if (!isCallable(updateFn) && !isCallable(insertFn)) {
19
- throw $TypeError('At least one callback required');
19
+ throw new $TypeError('At least one callback required');
20
20
  }
21
21
  if (call(has, map, key)) {
22
22
  value = call(get, map, key);
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+ var floatRound = require('../internals/math-float-round');
3
+
4
+ var FLOAT16_EPSILON = 0.0009765625;
5
+ var FLOAT16_MAX_VALUE = 65504;
6
+ var FLOAT16_MIN_VALUE = 6.103515625e-05;
7
+
8
+ // `Math.f16round` method implementation
9
+ // https://github.com/tc39/proposal-float16array
10
+ module.exports = Math.f16round || function f16round(x) {
11
+ return floatRound(x, FLOAT16_EPSILON, FLOAT16_MAX_VALUE, FLOAT16_MIN_VALUE);
12
+ };
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+ var sign = require('../internals/math-sign');
3
+
4
+ var abs = Math.abs;
5
+
6
+ var EPSILON = 2.220446049250313e-16; // Number.EPSILON
7
+ var INVERSE_EPSILON = 1 / EPSILON;
8
+
9
+ var roundTiesToEven = function (n) {
10
+ return n + INVERSE_EPSILON - INVERSE_EPSILON;
11
+ };
12
+
13
+ module.exports = function (x, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) {
14
+ var n = +x;
15
+ var absolute = abs(n);
16
+ var s = sign(n);
17
+ if (absolute < FLOAT_MIN_VALUE) return s * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON;
18
+ var a = (1 + FLOAT_EPSILON / EPSILON) * absolute;
19
+ var result = a - (a - absolute);
20
+ // eslint-disable-next-line no-self-compare -- NaN check
21
+ if (result > FLOAT_MAX_VALUE || result !== result) return s * Infinity;
22
+ return s * result;
23
+ };
@@ -1,29 +1,13 @@
1
1
  'use strict';
2
- var sign = require('../internals/math-sign');
2
+ var floatRound = require('../internals/math-float-round');
3
3
 
4
- var abs = Math.abs;
5
- var pow = Math.pow;
6
- var EPSILON = pow(2, -52);
7
- var EPSILON32 = pow(2, -23);
8
- var MAX32 = pow(2, 127) * (2 - EPSILON32);
9
- var MIN32 = pow(2, -126);
10
-
11
- var roundTiesToEven = function (n) {
12
- return n + 1 / EPSILON - 1 / EPSILON;
13
- };
4
+ var FLOAT32_EPSILON = 1.1920928955078125e-7; // 2 ** -23;
5
+ var FLOAT32_MAX_VALUE = 3.4028234663852886e+38; // 2 ** 128 - 2 ** 104
6
+ var FLOAT32_MIN_VALUE = 1.1754943508222875e-38; // 2 ** -126;
14
7
 
15
8
  // `Math.fround` method implementation
16
9
  // https://tc39.es/ecma262/#sec-math.fround
17
10
  // eslint-disable-next-line es/no-math-fround -- safe
18
11
  module.exports = Math.fround || function fround(x) {
19
- var n = +x;
20
- var $abs = abs(n);
21
- var $sign = sign(n);
22
- var a, result;
23
- if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
24
- a = (1 + EPSILON32 / EPSILON) * $abs;
25
- result = a - (a - $abs);
26
- // eslint-disable-next-line no-self-compare -- NaN check
27
- if (result > MAX32 || result !== result) return $sign * Infinity;
28
- return $sign * result;
12
+ return floatRound(x, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE);
29
13
  };
@@ -6,7 +6,7 @@ var $TypeError = TypeError;
6
6
  var PromiseCapability = function (C) {
7
7
  var resolve, reject;
8
8
  this.promise = new C(function ($$resolve, $$reject) {
9
- if (resolve !== undefined || reject !== undefined) throw $TypeError('Bad Promise constructor');
9
+ if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
10
10
  resolve = $$resolve;
11
11
  reject = $$reject;
12
12
  });
@@ -4,5 +4,5 @@ var $RangeError = RangeError;
4
4
  module.exports = function (it) {
5
5
  // eslint-disable-next-line no-self-compare -- NaN check
6
6
  if (it === it) return it;
7
- throw $RangeError('NaN is not allowed');
7
+ throw new $RangeError('NaN is not allowed');
8
8
  };
@@ -5,6 +5,6 @@ var $TypeError = TypeError;
5
5
 
6
6
  module.exports = function (it) {
7
7
  if (isRegExp(it)) {
8
- throw $TypeError("The method doesn't accept regular expressions");
8
+ throw new $TypeError("The method doesn't accept regular expressions");
9
9
  } return it;
10
10
  };
@@ -19,10 +19,10 @@ var $TypeError = TypeError;
19
19
  var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(start, end, option, type, zero, one) {
20
20
  // TODO: Drop the first `typeof` check after removing legacy methods in `core-js@4`
21
21
  if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) {
22
- throw $TypeError(INCORRECT_RANGE);
22
+ throw new $TypeError(INCORRECT_RANGE);
23
23
  }
24
24
  if (start === Infinity || start === -Infinity) {
25
- throw $RangeError(INCORRECT_RANGE);
25
+ throw new $RangeError(INCORRECT_RANGE);
26
26
  }
27
27
  var ifIncrease = end > start;
28
28
  var inclusiveEnd = false;
@@ -35,16 +35,16 @@ var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(sta
35
35
  } else if (typeof option == type) {
36
36
  step = option;
37
37
  } else {
38
- throw $TypeError(INCORRECT_RANGE);
38
+ throw new $TypeError(INCORRECT_RANGE);
39
39
  }
40
40
  if (isNullOrUndefined(step)) {
41
41
  step = ifIncrease ? one : -one;
42
42
  }
43
43
  if (typeof step != type) {
44
- throw $TypeError(INCORRECT_RANGE);
44
+ throw new $TypeError(INCORRECT_RANGE);
45
45
  }
46
46
  if (step === Infinity || step === -Infinity || (step === zero && start !== end)) {
47
- throw $RangeError(INCORRECT_RANGE);
47
+ throw new $RangeError(INCORRECT_RANGE);
48
48
  }
49
49
  // eslint-disable-next-line no-self-compare -- NaN check
50
50
  var hitsEnd = start !== start || end !== end || step !== step || (end > start) !== (step > zero);
@@ -38,7 +38,7 @@ exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P
38
38
  if (IE8_DOM_DEFINE) try {
39
39
  return $defineProperty(O, P, Attributes);
40
40
  } catch (error) { /* empty */ }
41
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
41
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
42
42
  if ('value' in Attributes) O[P] = Attributes.value;
43
43
  return O;
44
44
  };
@@ -12,5 +12,5 @@ module.exports = function (input, pref) {
12
12
  if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
13
13
  if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
14
14
  if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
15
- throw $TypeError("Can't convert object to primitive value");
15
+ throw new $TypeError("Can't convert object to primitive value");
16
16
  };
@@ -37,20 +37,20 @@ module.exports = function (source, i) {
37
37
  } else if (twoChars === '\\u') {
38
38
  i += 2;
39
39
  var fourHexDigits = slice(source, i, i + 4);
40
- if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw $SyntaxError('Bad Unicode escape at: ' + i);
40
+ if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i);
41
41
  value += fromCharCode($parseInt(fourHexDigits, 16));
42
42
  i += 4;
43
- } else throw $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
43
+ } else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
44
44
  } else if (chr === '"') {
45
45
  unterminated = false;
46
46
  i++;
47
47
  break;
48
48
  } else {
49
- if (exec(IS_C0_CONTROL_CODE, chr)) throw $SyntaxError('Bad control character in string literal at: ' + i);
49
+ if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i);
50
50
  value += chr;
51
51
  i++;
52
52
  }
53
53
  }
54
- if (unterminated) throw $SyntaxError('Unterminated string at: ' + i);
54
+ if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i);
55
55
  return { value: value, end: i };
56
56
  };
@@ -17,5 +17,5 @@ module.exports = function (R, S) {
17
17
  return result;
18
18
  }
19
19
  if (classof(R) === 'RegExp') return call(regexpExec, R, S);
20
- throw $TypeError('RegExp#exec called on incompatible receiver');
20
+ throw new $TypeError('RegExp#exec called on incompatible receiver');
21
21
  };
@@ -7,5 +7,5 @@ var $RegExp = global.RegExp;
7
7
 
8
8
  module.exports = fails(function () {
9
9
  var re = $RegExp('.', 's');
10
- return !(re.dotAll && re.exec('\n') && re.flags === 's');
10
+ return !(re.dotAll && re.test('\n') && re.flags === 's');
11
11
  });
@@ -6,6 +6,6 @@ var $TypeError = TypeError;
6
6
  // `RequireObjectCoercible` abstract operation
7
7
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
8
8
  module.exports = function (it) {
9
- if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
9
+ if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
10
10
  return it;
11
11
  };
@@ -5,9 +5,9 @@ var store = require('../internals/shared-store');
5
5
  (module.exports = function (key, value) {
6
6
  return store[key] || (store[key] = value !== undefined ? value : {});
7
7
  })('versions', []).push({
8
- version: '3.32.2',
8
+ version: '3.33.1',
9
9
  mode: IS_PURE ? 'pure' : 'global',
10
10
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
11
- license: 'https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE',
11
+ license: 'https://github.com/zloirock/core-js/blob/v3.33.1/LICENSE',
12
12
  source: 'https://github.com/zloirock/core-js'
13
13
  });
@@ -19,7 +19,7 @@ module.exports = function cooked(template /* , ...substitutions */) {
19
19
  var i = 0;
20
20
  while (true) {
21
21
  var nextVal = cookedTemplate[i++];
22
- if (nextVal === undefined) throw $TypeError('Incorrect template');
22
+ if (nextVal === undefined) throw new $TypeError('Incorrect template');
23
23
  push(elements, toString(nextVal));
24
24
  if (i === literalSegments) return join(elements, '');
25
25
  if (i < argumentsLength) push(elements, toString(arguments[i]));
@@ -131,7 +131,7 @@ var encode = function (input) {
131
131
  // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
132
132
  var handledCPCountPlusOne = handledCPCount + 1;
133
133
  if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
134
- throw $RangeError(OVERFLOW_ERROR);
134
+ throw new $RangeError(OVERFLOW_ERROR);
135
135
  }
136
136
 
137
137
  delta += (m - n) * handledCPCountPlusOne;
@@ -140,7 +140,7 @@ var encode = function (input) {
140
140
  for (i = 0; i < input.length; i++) {
141
141
  currentValue = input[i];
142
142
  if (currentValue < n && ++delta > maxInt) {
143
- throw $RangeError(OVERFLOW_ERROR);
143
+ throw new $RangeError(OVERFLOW_ERROR);
144
144
  }
145
145
  if (currentValue === n) {
146
146
  // Represent delta as a generalized variable-length integer.
@@ -11,7 +11,7 @@ module.exports = function repeat(count) {
11
11
  var str = toString(requireObjectCoercible(this));
12
12
  var result = '';
13
13
  var n = toIntegerOrInfinity(count);
14
- if (n < 0 || n === Infinity) throw $RangeError('Wrong number of repetitions');
14
+ if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions');
15
15
  for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
16
16
  return result;
17
17
  };
@@ -7,7 +7,7 @@ var $TypeError = TypeError;
7
7
  // https://tc39.es/ecma262/#sec-tobigint
8
8
  module.exports = function (argument) {
9
9
  var prim = toPrimitive(argument, 'number');
10
- if (typeof prim == 'number') throw $TypeError("Can't convert number to bigint");
10
+ if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint");
11
11
  // eslint-disable-next-line es/no-bigint -- safe
12
12
  return BigInt(prim);
13
13
  };
@@ -10,6 +10,6 @@ module.exports = function (it) {
10
10
  if (it === undefined) return 0;
11
11
  var number = toIntegerOrInfinity(it);
12
12
  var length = toLength(number);
13
- if (number !== length) throw $RangeError('Wrong length or index');
13
+ if (number !== length) throw new $RangeError('Wrong length or index');
14
14
  return length;
15
15
  };
@@ -5,6 +5,6 @@ var $RangeError = RangeError;
5
5
 
6
6
  module.exports = function (it, BYTES) {
7
7
  var offset = toPositiveInteger(it);
8
- if (offset % BYTES) throw $RangeError('Wrong offset');
8
+ if (offset % BYTES) throw new $RangeError('Wrong offset');
9
9
  return offset;
10
10
  };
@@ -5,6 +5,6 @@ var $RangeError = RangeError;
5
5
 
6
6
  module.exports = function (it) {
7
7
  var result = toIntegerOrInfinity(it);
8
- if (result < 0) throw $RangeError("The argument can't be less than 0");
8
+ if (result < 0) throw new $RangeError("The argument can't be less than 0");
9
9
  return result;
10
10
  };
@@ -19,7 +19,7 @@ module.exports = function (input, pref) {
19
19
  if (pref === undefined) pref = 'default';
20
20
  result = call(exoticToPrim, input, pref);
21
21
  if (!isObject(result) || isSymbol(result)) return result;
22
- throw $TypeError("Can't convert object to primitive value");
22
+ throw new $TypeError("Can't convert object to primitive value");
23
23
  }
24
24
  if (pref === undefined) pref = 'number';
25
25
  return ordinaryToPrimitive(input, pref);
@@ -4,6 +4,6 @@ var classof = require('../internals/classof');
4
4
  var $String = String;
5
5
 
6
6
  module.exports = function (argument) {
7
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
7
+ if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
8
8
  return $String(argument);
9
9
  };
@@ -167,12 +167,12 @@ if (DESCRIPTORS) {
167
167
  byteOffset = toOffset(offset, BYTES);
168
168
  var $len = data.byteLength;
169
169
  if ($length === undefined) {
170
- if ($len % BYTES) throw RangeError(WRONG_LENGTH);
170
+ if ($len % BYTES) throw new RangeError(WRONG_LENGTH);
171
171
  byteLength = $len - byteOffset;
172
- if (byteLength < 0) throw RangeError(WRONG_LENGTH);
172
+ if (byteLength < 0) throw new RangeError(WRONG_LENGTH);
173
173
  } else {
174
174
  byteLength = toLength($length) * BYTES;
175
- if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);
175
+ if (byteLength + byteOffset > $len) throw new RangeError(WRONG_LENGTH);
176
176
  }
177
177
  length = byteLength / BYTES;
178
178
  } else if (isTypedArray(data)) {
@@ -2,6 +2,6 @@
2
2
  var $TypeError = TypeError;
3
3
 
4
4
  module.exports = function (passed, required) {
5
- if (passed < required) throw $TypeError('Not enough arguments');
5
+ if (passed < required) throw new $TypeError('Not enough arguments');
6
6
  return passed;
7
7
  };
@@ -21,7 +21,7 @@ var $AggregateError = function AggregateError(errors, message /* , options */) {
21
21
  var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
22
22
  var that;
23
23
  if (setPrototypeOf) {
24
- that = setPrototypeOf($Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
24
+ that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
25
25
  } else {
26
26
  that = isInstance ? this : create(AggregateErrorPrototype);
27
27
  createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
@@ -35,13 +35,12 @@ module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
35
35
  }, function () {
36
36
  var state = getInternalState(this);
37
37
  var target = state.target;
38
- var kind = state.kind;
39
38
  var index = state.index++;
40
39
  if (!target || index >= target.length) {
41
40
  state.target = undefined;
42
41
  return createIterResultObject(undefined, true);
43
42
  }
44
- switch (kind) {
43
+ switch (state.kind) {
45
44
  case 'keys': return createIterResultObject(index, false);
46
45
  case 'values': return createIterResultObject(target[index], false);
47
46
  } return createIterResultObject([index, target[index]], false);
@@ -4,11 +4,11 @@ var uncurryThis = require('../internals/function-uncurry-this');
4
4
  var aCallable = require('../internals/a-callable');
5
5
  var toIndexedObject = require('../internals/to-indexed-object');
6
6
  var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
7
- var getVirtual = require('../internals/entry-virtual');
7
+ var getBuiltInPrototypeMethod = require('../internals/get-built-in-prototype-method');
8
8
  var addToUnscopables = require('../internals/add-to-unscopables');
9
9
 
10
10
  var $Array = Array;
11
- var sort = uncurryThis(getVirtual('Array').sort);
11
+ var sort = uncurryThis(getBuiltInPrototypeMethod('Array', 'sort'));
12
12
 
13
13
  // `Array.prototype.toSorted` method
14
14
  // https://tc39.es/ecma262/#sec-array.prototype.tosorted
@@ -8,7 +8,8 @@ var wrapErrorConstructorWithCause = require('../internals/wrap-error-constructor
8
8
  var WEB_ASSEMBLY = 'WebAssembly';
9
9
  var WebAssembly = global[WEB_ASSEMBLY];
10
10
 
11
- var FORCED = Error('e', { cause: 7 }).cause !== 7;
11
+ // eslint-disable-next-line es/no-error-cause -- feature detection
12
+ var FORCED = new Error('e', { cause: 7 }).cause !== 7;
12
13
 
13
14
  var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
14
15
  var O = {};
@@ -38,7 +38,7 @@ var toNumeric = function (value) {
38
38
  var toNumber = function (argument) {
39
39
  var it = toPrimitive(argument, 'number');
40
40
  var first, third, radix, maxCode, digits, length, index, code;
41
- if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number');
41
+ if (isSymbol(it)) throw new TypeError('Cannot convert a Symbol value to a number');
42
42
  if (typeof it == 'string' && it.length > 2) {
43
43
  it = trim(it);
44
44
  first = charCodeAt(it, 0);
@@ -55,7 +55,7 @@ $({ target: 'Number', proto: true, forced: FORCED }, {
55
55
  var f = toIntegerOrInfinity(fractionDigits);
56
56
  if (!$isFinite(x)) return String(x);
57
57
  // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation
58
- if (f < 0 || f > 20) throw $RangeError('Incorrect fraction digits');
58
+ if (f < 0 || f > 20) throw new $RangeError('Incorrect fraction digits');
59
59
  if (ROUNDS_PROPERLY) return nativeToExponential(x, f);
60
60
  var s = '';
61
61
  var m = '';
@@ -83,7 +83,7 @@ $({ target: 'Number', proto: true, forced: FORCED }, {
83
83
  var e, z, j, k;
84
84
 
85
85
  // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation
86
- if (fractDigits < 0 || fractDigits > 20) throw $RangeError('Incorrect fraction digits');
86
+ if (fractDigits < 0 || fractDigits > 20) throw new $RangeError('Incorrect fraction digits');
87
87
  // eslint-disable-next-line no-self-compare -- NaN check
88
88
  if (number !== number) return 'NaN';
89
89
  if (number <= -1e21 || number >= 1e21) return $String(number);
@@ -79,7 +79,7 @@ var callReaction = function (reaction, state) {
79
79
  }
80
80
  }
81
81
  if (result === reaction.promise) {
82
- reject(TypeError('Promise-chain cycle'));
82
+ reject(new TypeError('Promise-chain cycle'));
83
83
  } else if (then = isThenable(result)) {
84
84
  call(then, result, resolve, reject);
85
85
  } else resolve(result);
@@ -169,7 +169,7 @@ var internalResolve = function (state, value, unwrap) {
169
169
  state.done = true;
170
170
  if (unwrap) state = unwrap;
171
171
  try {
172
- if (state.facade === value) throw TypeError("Promise can't be resolved itself");
172
+ if (state.facade === value) throw new TypeError("Promise can't be resolved itself");
173
173
  var then = isThenable(value);
174
174
  if (then) {
175
175
  microtask(function () {
@@ -20,7 +20,7 @@ if (DESCRIPTORS && UNSUPPORTED_DOT_ALL) {
20
20
  if (classof(this) === 'RegExp') {
21
21
  return !!getInternalState(this).dotAll;
22
22
  }
23
- throw $TypeError('Incompatible receiver, RegExp required');
23
+ throw new $TypeError('Incompatible receiver, RegExp required');
24
24
  }
25
25
  });
26
26
  }
@@ -20,7 +20,7 @@ if (DESCRIPTORS && MISSED_STICKY) {
20
20
  if (classof(this) === 'RegExp') {
21
21
  return !!getInternalState(this).sticky;
22
22
  }
23
- throw $TypeError('Incompatible receiver, RegExp required');
23
+ throw new $TypeError('Incompatible receiver, RegExp required');
24
24
  }
25
25
  });
26
26
  }
@@ -23,7 +23,7 @@ $({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, {
23
23
  var code;
24
24
  while (length > i) {
25
25
  code = +arguments[i++];
26
- if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw $RangeError(code + ' is not a valid code point');
26
+ if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw new $RangeError(code + ' is not a valid code point');
27
27
  elements[i] = code < 0x10000
28
28
  ? fromCharCode(code)
29
29
  : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00);
@@ -86,7 +86,7 @@ $({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {
86
86
  if (!isNullOrUndefined(regexp)) {
87
87
  if (isRegExp(regexp)) {
88
88
  flags = toString(requireObjectCoercible(getRegExpFlags(regexp)));
89
- if (!~stringIndexOf(flags, 'g')) throw $TypeError('`.matchAll` does not allow non-global regexes');
89
+ if (!~stringIndexOf(flags, 'g')) throw new $TypeError('`.matchAll` does not allow non-global regexes');
90
90
  }
91
91
  if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp);
92
92
  matcher = getMethod(regexp, MATCH_ALL);
@@ -39,7 +39,7 @@ $({ target: 'String', proto: true }, {
39
39
  IS_REG_EXP = isRegExp(searchValue);
40
40
  if (IS_REG_EXP) {
41
41
  flags = toString(requireObjectCoercible(getRegExpFlags(searchValue)));
42
- if (!~indexOf(flags, 'g')) throw $TypeError('`.replaceAll` does not allow non-global regexes');
42
+ if (!~indexOf(flags, 'g')) throw new $TypeError('`.replaceAll` does not allow non-global regexes');
43
43
  }
44
44
  replacer = getMethod(searchValue, REPLACE);
45
45
  if (replacer) {