core-js 3.42.0 → 3.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/actual/array/from-async.js +2 -6
  2. package/actual/array/index.js +0 -2
  3. package/actual/async-disposable-stack/constructor.js +2 -6
  4. package/actual/async-disposable-stack/index.js +2 -6
  5. package/actual/async-iterator/async-dispose.js +1 -2
  6. package/actual/async-iterator/index.js +1 -2
  7. package/actual/disposable-stack/constructor.js +2 -5
  8. package/actual/disposable-stack/index.js +2 -5
  9. package/actual/error/is-error.js +2 -3
  10. package/actual/suppressed-error.js +2 -4
  11. package/actual/symbol/async-dispose.js +2 -2
  12. package/actual/symbol/dispose.js +2 -2
  13. package/es/array/from-async.js +9 -0
  14. package/es/array/index.js +2 -0
  15. package/es/async-disposable-stack/constructor.js +12 -0
  16. package/es/async-disposable-stack/index.js +12 -0
  17. package/es/async-iterator/async-dispose.js +4 -0
  18. package/es/async-iterator/index.js +4 -0
  19. package/es/disposable-stack/constructor.js +10 -0
  20. package/es/disposable-stack/index.js +10 -0
  21. package/es/error/index.js +1 -0
  22. package/es/error/is-error.js +6 -0
  23. package/es/index.js +9 -0
  24. package/es/iterator/dispose.js +2 -0
  25. package/es/iterator/flat-map.js +1 -0
  26. package/es/iterator/index.js +1 -0
  27. package/es/suppressed-error.js +7 -0
  28. package/es/symbol/async-dispose.js +5 -0
  29. package/es/symbol/dispose.js +5 -0
  30. package/es/symbol/index.js +2 -0
  31. package/features/instance/clamp.js +2 -0
  32. package/features/iterator/chunks.js +2 -0
  33. package/features/iterator/sliding.js +2 -0
  34. package/features/iterator/windows.js +2 -0
  35. package/features/iterator/zip-keyed.js +2 -0
  36. package/features/iterator/zip.js +2 -0
  37. package/features/number/clamp.js +2 -0
  38. package/features/number/virtual/clamp.js +2 -0
  39. package/full/index.js +15 -0
  40. package/full/instance/clamp.js +14 -0
  41. package/full/iterator/chunks.js +8 -0
  42. package/full/iterator/concat.js +3 -0
  43. package/full/iterator/from.js +2 -0
  44. package/full/iterator/index.js +5 -0
  45. package/full/iterator/range.js +18 -0
  46. package/full/iterator/sliding.js +8 -0
  47. package/full/iterator/windows.js +8 -0
  48. package/full/iterator/zip-keyed.js +26 -0
  49. package/full/iterator/zip.js +24 -0
  50. package/full/math/clamp.js +1 -0
  51. package/full/math/index.js +1 -0
  52. package/full/number/clamp.js +5 -0
  53. package/full/number/index.js +1 -0
  54. package/full/number/virtual/clamp.js +5 -0
  55. package/internals/array-to-reversed.js +2 -2
  56. package/internals/array-with.js +2 -2
  57. package/internals/async-iterator-iteration.js +6 -1
  58. package/internals/async-iterator-map.js +1 -1
  59. package/internals/error-stack-install.js +1 -0
  60. package/internals/flatten-into-array.js +1 -1
  61. package/internals/get-iterator-direct.js +1 -1
  62. package/internals/get-iterator-record.js +7 -0
  63. package/internals/get-mode-option.js +8 -0
  64. package/internals/install-error-cause.js +1 -1
  65. package/internals/iterate.js +1 -1
  66. package/internals/iterator-close-all.js +16 -0
  67. package/internals/iterator-create-proxy.js +11 -3
  68. package/internals/iterator-helper-throws-on-invalid-iterator.js +12 -0
  69. package/internals/iterator-window.js +45 -0
  70. package/internals/iterator-zip.js +100 -0
  71. package/internals/math-clamp.js +9 -0
  72. package/internals/regexp-flags-detection.js +47 -0
  73. package/internals/regexp-get-flags.js +8 -5
  74. package/internals/set-difference.js +2 -2
  75. package/internals/set-intersection.js +1 -1
  76. package/internals/set-is-disjoint-from.js +1 -1
  77. package/internals/set-is-subset-of.js +1 -1
  78. package/internals/set-is-superset-of.js +1 -1
  79. package/internals/set-method-get-keys-before-cloning-detection.js +30 -0
  80. package/internals/set-symmetric-difference.js +1 -1
  81. package/internals/set-union.js +1 -1
  82. package/internals/shared-store.js +2 -2
  83. package/internals/string-pad.js +0 -1
  84. package/internals/this-number-value.js +1 -1
  85. package/internals/uid.js +1 -1
  86. package/modules/es.array-buffer.transfer-to-fixed-length.js +1 -1
  87. package/modules/es.array-buffer.transfer.js +1 -1
  88. package/modules/es.array.from-async.js +22 -0
  89. package/modules/es.array.with.js +11 -1
  90. package/modules/es.async-disposable-stack.constructor.js +135 -0
  91. package/modules/es.async-iterator.async-dispose.js +26 -0
  92. package/modules/es.data-view.get-float16.js +1 -2
  93. package/modules/es.data-view.set-float16.js +6 -4
  94. package/modules/es.disposable-stack.constructor.js +114 -0
  95. package/modules/es.error.is-error.js +37 -0
  96. package/modules/es.escape.js +1 -1
  97. package/modules/es.iterator.dispose.js +17 -0
  98. package/modules/es.iterator.drop.js +7 -2
  99. package/modules/es.iterator.filter.js +7 -2
  100. package/modules/es.iterator.flat-map.js +8 -2
  101. package/modules/es.iterator.from.js +12 -1
  102. package/modules/es.iterator.map.js +7 -2
  103. package/modules/es.json.stringify.js +1 -1
  104. package/modules/es.number.to-exponential.js +1 -1
  105. package/modules/es.number.to-fixed.js +1 -1
  106. package/modules/es.number.to-precision.js +1 -1
  107. package/modules/es.promise.constructor.js +3 -0
  108. package/modules/es.regexp.flags.js +10 -50
  109. package/modules/es.set.difference.v2.js +25 -2
  110. package/modules/es.set.symmetric-difference.v2.js +4 -1
  111. package/modules/es.set.union.v2.js +4 -1
  112. package/modules/es.string.match.js +8 -2
  113. package/modules/es.string.replace.js +4 -2
  114. package/modules/es.suppressed-error.constructor.js +64 -0
  115. package/modules/es.symbol.async-dispose.js +21 -0
  116. package/modules/es.symbol.constructor.js +1 -1
  117. package/modules/es.symbol.dispose.js +21 -0
  118. package/modules/es.typed-array.with.js +12 -2
  119. package/modules/esnext.array.from-async.js +2 -21
  120. package/modules/esnext.array.last-index.js +1 -1
  121. package/modules/esnext.array.last-item.js +1 -1
  122. package/modules/esnext.async-disposable-stack.constructor.js +2 -134
  123. package/modules/esnext.async-iterator.async-dispose.js +2 -25
  124. package/modules/esnext.data-view.set-uint8-clamped.js +5 -3
  125. package/modules/esnext.disposable-stack.constructor.js +2 -113
  126. package/modules/esnext.error.is-error.js +2 -35
  127. package/modules/esnext.iterator.chunks.js +44 -0
  128. package/modules/esnext.iterator.concat.js +3 -4
  129. package/modules/esnext.iterator.dispose.js +2 -16
  130. package/modules/esnext.iterator.sliding.js +11 -0
  131. package/modules/esnext.iterator.windows.js +11 -0
  132. package/modules/esnext.iterator.zip-keyed.js +70 -0
  133. package/modules/esnext.iterator.zip.js +91 -0
  134. package/modules/esnext.math.clamp.js +3 -14
  135. package/modules/esnext.number.clamp.js +12 -0
  136. package/modules/esnext.number.from-string.js +1 -1
  137. package/modules/esnext.suppressed-error.constructor.js +2 -63
  138. package/modules/esnext.symbol.async-dispose.js +2 -20
  139. package/modules/esnext.symbol.dispose.js +2 -20
  140. package/modules/esnext.uint8-array.from-base64.js +9 -1
  141. package/modules/esnext.uint8-array.set-from-base64.js +6 -2
  142. package/modules/esnext.uint8-array.to-base64.js +12 -1
  143. package/modules/esnext.uint8-array.to-hex.js +13 -2
  144. package/modules/web.structured-clone.js +1 -1
  145. package/modules/web.url.constructor.js +2 -1
  146. package/package.json +1 -1
  147. package/proposals/function-un-this.js +1 -1
  148. package/proposals/iterator-chunking.js +5 -0
  149. package/proposals/joint-iteration.js +4 -0
  150. package/proposals/math-clamp-v2.js +3 -0
  151. package/proposals/math-clamp.js +1 -1
  152. package/proposals/string-cooked.js +1 -1
  153. package/stable/array/from-async.js +4 -0
  154. package/stable/async-disposable-stack/constructor.js +4 -0
  155. package/stable/async-disposable-stack/index.js +4 -0
  156. package/stable/async-iterator/async-dispose.js +2 -0
  157. package/stable/async-iterator/index.js +2 -0
  158. package/stable/disposable-stack/constructor.js +4 -0
  159. package/stable/disposable-stack/index.js +4 -0
  160. package/stable/error/is-error.js +4 -0
  161. package/stable/index.js +9 -0
  162. package/stable/iterator/dispose.js +4 -0
  163. package/stable/iterator/flat-map.js +1 -0
  164. package/stable/suppressed-error.js +4 -0
  165. package/stable/symbol/async-dispose.js +4 -0
  166. package/stable/symbol/dispose.js +4 -0
  167. package/stage/1.js +2 -1
  168. package/stage/2.js +3 -0
  169. package/stage/3.js +0 -3
  170. package/stage/4.js +3 -0
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var anObject = require('../internals/an-object');
4
+ var call = require('../internals/function-call');
5
+ var createIteratorProxy = require('../internals/iterator-create-proxy');
6
+ var getIteratorDirect = require('../internals/get-iterator-direct');
7
+ var iteratorClose = require('../internals/iterator-close');
8
+ var uncurryThis = require('../internals/function-uncurry-this');
9
+
10
+ var $RangeError = RangeError;
11
+ var push = uncurryThis([].push);
12
+
13
+ var IteratorProxy = createIteratorProxy(function () {
14
+ var iterator = this.iterator;
15
+ var next = this.next;
16
+ var chunkSize = this.chunkSize;
17
+ var buffer = [];
18
+ var result, done;
19
+ while (true) {
20
+ result = anObject(call(next, iterator));
21
+ done = !!result.done;
22
+ if (done) {
23
+ if (buffer.length) return buffer;
24
+ this.done = true;
25
+ return;
26
+ }
27
+ push(buffer, result.value);
28
+ if (buffer.length === chunkSize) return buffer;
29
+ }
30
+ });
31
+
32
+ // `Iterator.prototype.chunks` method
33
+ // https://github.com/tc39/proposal-iterator-chunking
34
+ $({ target: 'Iterator', proto: true, real: true, forced: true }, {
35
+ chunks: function chunks(chunkSize) {
36
+ var O = anObject(this);
37
+ if (typeof chunkSize != 'number' || !chunkSize || chunkSize >>> 0 !== chunkSize) {
38
+ return iteratorClose(O, 'throw', new $RangeError('chunkSize must be integer in [1, 2^32-1]'));
39
+ }
40
+ return new IteratorProxy(getIteratorDirect(O), {
41
+ chunkSize: chunkSize
42
+ });
43
+ }
44
+ });
@@ -5,7 +5,6 @@ var aCallable = require('../internals/a-callable');
5
5
  var anObject = require('../internals/an-object');
6
6
  var getIteratorMethod = require('../internals/get-iterator-method');
7
7
  var createIteratorProxy = require('../internals/iterator-create-proxy');
8
- var createIterResultObject = require('../internals/create-iter-result-object');
9
8
 
10
9
  var $Array = Array;
11
10
 
@@ -17,7 +16,7 @@ var IteratorProxy = createIteratorProxy(function () {
17
16
  var iterables = this.iterables;
18
17
  if (iterableIndex >= iterables.length) {
19
18
  this.done = true;
20
- return createIterResultObject(undefined, true);
19
+ return;
21
20
  }
22
21
  var entry = iterables[iterableIndex];
23
22
  this.iterables[iterableIndex] = null;
@@ -30,9 +29,9 @@ var IteratorProxy = createIteratorProxy(function () {
30
29
  this.next = null;
31
30
  continue;
32
31
  }
33
- return result;
32
+ return result.value;
34
33
  }
35
- }, false, true);
34
+ });
36
35
 
37
36
  // `Iterator.concat` method
38
37
  // https://github.com/tc39/proposal-iterator-sequencing
@@ -1,17 +1,3 @@
1
1
  'use strict';
2
- // https://github.com/tc39/proposal-explicit-resource-management
3
- var call = require('../internals/function-call');
4
- var defineBuiltIn = require('../internals/define-built-in');
5
- var getMethod = require('../internals/get-method');
6
- var hasOwn = require('../internals/has-own-property');
7
- var wellKnownSymbol = require('../internals/well-known-symbol');
8
- var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
9
-
10
- var DISPOSE = wellKnownSymbol('dispose');
11
-
12
- if (!hasOwn(IteratorPrototype, DISPOSE)) {
13
- defineBuiltIn(IteratorPrototype, DISPOSE, function () {
14
- var $return = getMethod(this, 'return');
15
- if ($return) call($return, this);
16
- });
17
- }
2
+ // TODO: Remove from `core-js@4`
3
+ require('../modules/es.iterator.dispose');
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var iteratorWindow = require('../internals/iterator-window');
4
+
5
+ // `Iterator.prototype.sliding` method
6
+ // https://github.com/tc39/proposal-iterator-chunking
7
+ $({ target: 'Iterator', proto: true, real: true, forced: true }, {
8
+ sliding: function sliding(windowSize) {
9
+ return iteratorWindow(this, windowSize, true);
10
+ }
11
+ });
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var iteratorWindow = require('../internals/iterator-window');
4
+
5
+ // `Iterator.prototype.windows` method
6
+ // https://github.com/tc39/proposal-iterator-chunking
7
+ $({ target: 'Iterator', proto: true, real: true, forced: true }, {
8
+ windows: function windows(windowSize) {
9
+ return iteratorWindow(this, windowSize, false);
10
+ }
11
+ });
@@ -0,0 +1,70 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var anObject = require('../internals/an-object');
4
+ var anObjectOrUndefined = require('../internals/an-object-or-undefined');
5
+ var call = require('../internals/function-call');
6
+ var uncurryThis = require('../internals/function-uncurry-this');
7
+ var getBuiltIn = require('../internals/get-built-in');
8
+ var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');
9
+ var getIteratorFlattenable = require('../internals/get-iterator-flattenable');
10
+ var getModeOption = require('../internals/get-mode-option');
11
+ var iteratorCloseAll = require('../internals/iterator-close-all');
12
+ var iteratorZip = require('../internals/iterator-zip');
13
+
14
+ var create = getBuiltIn('Object', 'create');
15
+ var ownKeys = getBuiltIn('Reflect', 'ownKeys');
16
+ var push = uncurryThis([].push);
17
+ var THROW = 'throw';
18
+
19
+ // `Iterator.zipKeyed` method
20
+ // https://github.com/tc39/proposal-joint-iteration
21
+ $({ target: 'Iterator', stat: true, forced: true }, {
22
+ zipKeyed: function zipKeyed(iterables /* , options */) {
23
+ anObject(iterables);
24
+ var options = arguments.length > 1 ? anObjectOrUndefined(arguments[1]) : undefined;
25
+ var mode = getModeOption(options);
26
+ var paddingOption = mode === 'longest' ? anObjectOrUndefined(options && options.padding) : undefined;
27
+
28
+ var iters = [];
29
+ var padding = [];
30
+ var allKeys = ownKeys(iterables);
31
+ var keys = [];
32
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
33
+ var i, key, value;
34
+ for (i = 0; i < allKeys.length; i++) try {
35
+ key = allKeys[i];
36
+ if (!call(propertyIsEnumerable, iterables, key)) continue;
37
+ value = iterables[key];
38
+ if (value !== undefined) {
39
+ push(keys, key);
40
+ push(iters, getIteratorFlattenable(value, true));
41
+ }
42
+ } catch (error) {
43
+ return iteratorCloseAll(iters, THROW, error);
44
+ }
45
+
46
+ var iterCount = iters.length;
47
+ if (mode === 'longest') {
48
+ if (paddingOption === undefined) {
49
+ for (i = 0; i < iterCount; i++) push(padding, undefined);
50
+ } else {
51
+ for (i = 0; i < keys.length; i++) {
52
+ try {
53
+ value = paddingOption[keys[i]];
54
+ } catch (error) {
55
+ return iteratorCloseAll(iters, THROW, error);
56
+ }
57
+ push(padding, value);
58
+ }
59
+ }
60
+ }
61
+
62
+ return iteratorZip(iters, mode, padding, function (results) {
63
+ var obj = create(null);
64
+ for (var j = 0; j < iterCount; j++) {
65
+ obj[keys[j]] = results[j];
66
+ }
67
+ return obj;
68
+ });
69
+ }
70
+ });
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var anObject = require('../internals/an-object');
4
+ var anObjectOrUndefined = require('../internals/an-object-or-undefined');
5
+ var call = require('../internals/function-call');
6
+ var uncurryThis = require('../internals/function-uncurry-this');
7
+ var getIteratorRecord = require('../internals/get-iterator-record');
8
+ var getIteratorFlattenable = require('../internals/get-iterator-flattenable');
9
+ var getModeOption = require('../internals/get-mode-option');
10
+ var iteratorClose = require('../internals/iterator-close');
11
+ var iteratorCloseAll = require('../internals/iterator-close-all');
12
+ var iteratorZip = require('../internals/iterator-zip');
13
+
14
+ var concat = uncurryThis([].concat);
15
+ var push = uncurryThis([].push);
16
+ var THROW = 'throw';
17
+
18
+ // `Iterator.zip` method
19
+ // https://github.com/tc39/proposal-joint-iteration
20
+ $({ target: 'Iterator', stat: true, forced: true }, {
21
+ zip: function zip(iterables /* , options */) {
22
+ anObject(iterables);
23
+ var options = arguments.length > 1 ? anObjectOrUndefined(arguments[1]) : undefined;
24
+ var mode = getModeOption(options);
25
+ var paddingOption = mode === 'longest' ? anObjectOrUndefined(options && options.padding) : undefined;
26
+
27
+ var iters = [];
28
+ var padding = [];
29
+ var inputIter = getIteratorRecord(iterables);
30
+ var iter, done, next;
31
+ while (!done) {
32
+ try {
33
+ next = anObject(call(inputIter.next, inputIter.iterator));
34
+ done = next.done;
35
+ } catch (error) {
36
+ return iteratorCloseAll(iters, THROW, error);
37
+ }
38
+ if (!done) {
39
+ try {
40
+ iter = getIteratorFlattenable(next.value, true);
41
+ } catch (error) {
42
+ return iteratorCloseAll(concat([inputIter.iterator], iters), THROW, error);
43
+ }
44
+ push(iters, iter);
45
+ }
46
+ }
47
+
48
+ var iterCount = iters.length;
49
+ var i, paddingDone, paddingIter;
50
+ if (mode === 'longest') {
51
+ if (paddingOption === undefined) {
52
+ for (i = 0; i < iterCount; i++) push(padding, undefined);
53
+ } else {
54
+ try {
55
+ paddingIter = getIteratorRecord(paddingOption);
56
+ } catch (error) {
57
+ return iteratorCloseAll(iters, THROW, error);
58
+ }
59
+ var usingIterator = true;
60
+ for (i = 0; i < iterCount; i++) {
61
+ if (usingIterator) {
62
+ try {
63
+ next = anObject(call(paddingIter.next, paddingIter.iterator));
64
+ paddingDone = next.done;
65
+ next = next.value;
66
+ } catch (error) {
67
+ return iteratorCloseAll(iters, THROW, error);
68
+ }
69
+ if (paddingDone) {
70
+ usingIterator = false;
71
+ } else {
72
+ push(padding, next);
73
+ }
74
+ } else {
75
+ push(padding, undefined);
76
+ }
77
+ }
78
+
79
+ if (usingIterator) {
80
+ try {
81
+ iteratorClose(paddingIter.iterator, 'normal');
82
+ } catch (error) {
83
+ return iteratorCloseAll(iters, THROW, error);
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
+ return iteratorZip(iters, mode, padding);
90
+ }
91
+ });
@@ -1,21 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var aNumber = require('../internals/a-number');
4
- var notANaN = require('../internals/not-a-nan');
5
- var sameValue = require('../internals/same-value');
6
-
7
- var $RangeError = RangeError;
8
- var $min = Math.min;
9
- var $max = Math.max;
3
+ var clamp = require('../internals/math-clamp');
10
4
 
5
+ // TODO: Remove from `core-js@4`
11
6
  // `Math.clamp` method
12
7
  // https://github.com/tc39/proposal-math-clamp
13
8
  $({ target: 'Math', stat: true, forced: true }, {
14
- clamp: function clamp(value, min, max) {
15
- aNumber(value);
16
- notANaN(aNumber(min));
17
- notANaN(aNumber(max));
18
- if ((sameValue(min, 0) && sameValue(max, -0)) || min > max) throw new $RangeError('`min` should be smaller than `max`');
19
- return $min(max, $max(min, value));
20
- }
9
+ clamp: clamp
21
10
  });
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var $clamp = require('../internals/math-clamp');
4
+ var thisNumberValue = require('../internals/this-number-value');
5
+
6
+ // `Number.prototype.clamp` method
7
+ // https://github.com/tc39/proposal-math-clamp
8
+ $({ target: 'Number', proto: true, forced: true }, {
9
+ clamp: function clamp(min, max) {
10
+ return $clamp(thisNumberValue(this), min, max);
11
+ }
12
+ });
@@ -13,7 +13,7 @@ var pow = Math.pow;
13
13
  var valid = /^[\d.a-z]+$/;
14
14
  var charAt = uncurryThis(''.charAt);
15
15
  var exec = uncurryThis(valid.exec);
16
- var numberToString = uncurryThis(1.0.toString);
16
+ var numberToString = uncurryThis(1.1.toString);
17
17
  var stringSlice = uncurryThis(''.slice);
18
18
  var split = uncurryThis(''.split);
19
19
 
@@ -1,64 +1,3 @@
1
1
  'use strict';
2
- var $ = require('../internals/export');
3
- var globalThis = require('../internals/global-this');
4
- var isPrototypeOf = require('../internals/object-is-prototype-of');
5
- var getPrototypeOf = require('../internals/object-get-prototype-of');
6
- var setPrototypeOf = require('../internals/object-set-prototype-of');
7
- var copyConstructorProperties = require('../internals/copy-constructor-properties');
8
- var create = require('../internals/object-create');
9
- var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
10
- var createPropertyDescriptor = require('../internals/create-property-descriptor');
11
- var installErrorStack = require('../internals/error-stack-install');
12
- var normalizeStringArgument = require('../internals/normalize-string-argument');
13
- var wellKnownSymbol = require('../internals/well-known-symbol');
14
- var fails = require('../internals/fails');
15
- var IS_PURE = require('../internals/is-pure');
16
-
17
- var NativeSuppressedError = globalThis.SuppressedError;
18
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
19
- var $Error = Error;
20
-
21
- // https://github.com/oven-sh/bun/issues/9282
22
- var WRONG_ARITY = !!NativeSuppressedError && NativeSuppressedError.length !== 3;
23
-
24
- // https://github.com/oven-sh/bun/issues/9283
25
- var EXTRA_ARGS_SUPPORT = !!NativeSuppressedError && fails(function () {
26
- return new NativeSuppressedError(1, 2, 3, { cause: 4 }).cause === 4;
27
- });
28
-
29
- var PATCH = WRONG_ARITY || EXTRA_ARGS_SUPPORT;
30
-
31
- var $SuppressedError = function SuppressedError(error, suppressed, message) {
32
- var isInstance = isPrototypeOf(SuppressedErrorPrototype, this);
33
- var that;
34
- if (setPrototypeOf) {
35
- that = PATCH && (!isInstance || getPrototypeOf(this) === SuppressedErrorPrototype)
36
- ? new NativeSuppressedError()
37
- : setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : SuppressedErrorPrototype);
38
- } else {
39
- that = isInstance ? this : create(SuppressedErrorPrototype);
40
- createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
41
- }
42
- if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
43
- installErrorStack(that, $SuppressedError, that.stack, 1);
44
- createNonEnumerableProperty(that, 'error', error);
45
- createNonEnumerableProperty(that, 'suppressed', suppressed);
46
- return that;
47
- };
48
-
49
- if (setPrototypeOf) setPrototypeOf($SuppressedError, $Error);
50
- else copyConstructorProperties($SuppressedError, $Error, { name: true });
51
-
52
- var SuppressedErrorPrototype = $SuppressedError.prototype = PATCH ? NativeSuppressedError.prototype : create($Error.prototype, {
53
- constructor: createPropertyDescriptor(1, $SuppressedError),
54
- message: createPropertyDescriptor(1, ''),
55
- name: createPropertyDescriptor(1, 'SuppressedError')
56
- });
57
-
58
- if (PATCH && !IS_PURE) SuppressedErrorPrototype.constructor = $SuppressedError;
59
-
60
- // `SuppressedError` constructor
61
- // https://github.com/tc39/proposal-explicit-resource-management
62
- $({ global: true, constructor: true, arity: 3, forced: PATCH }, {
63
- SuppressedError: $SuppressedError
64
- });
2
+ // TODO: Remove from `core-js@4`
3
+ require('../modules/es.suppressed-error.constructor');
@@ -1,21 +1,3 @@
1
1
  'use strict';
2
- var globalThis = require('../internals/global-this');
3
- var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
4
- var defineProperty = require('../internals/object-define-property').f;
5
- var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
6
-
7
- var Symbol = globalThis.Symbol;
8
-
9
- // `Symbol.asyncDispose` well-known symbol
10
- // https://github.com/tc39/proposal-async-explicit-resource-management
11
- defineWellKnownSymbol('asyncDispose');
12
-
13
- if (Symbol) {
14
- var descriptor = getOwnPropertyDescriptor(Symbol, 'asyncDispose');
15
- // workaround of NodeJS 20.4 bug
16
- // https://github.com/nodejs/node/issues/48699
17
- // and incorrect descriptor from some transpilers and userland helpers
18
- if (descriptor.enumerable && descriptor.configurable && descriptor.writable) {
19
- defineProperty(Symbol, 'asyncDispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false });
20
- }
21
- }
2
+ // TODO: Remove from `core-js@4`
3
+ require('../modules/es.symbol.async-dispose');
@@ -1,21 +1,3 @@
1
1
  'use strict';
2
- var globalThis = require('../internals/global-this');
3
- var defineWellKnownSymbol = require('../internals/well-known-symbol-define');
4
- var defineProperty = require('../internals/object-define-property').f;
5
- var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
6
-
7
- var Symbol = globalThis.Symbol;
8
-
9
- // `Symbol.dispose` well-known symbol
10
- // https://github.com/tc39/proposal-explicit-resource-management
11
- defineWellKnownSymbol('dispose');
12
-
13
- if (Symbol) {
14
- var descriptor = getOwnPropertyDescriptor(Symbol, 'dispose');
15
- // workaround of NodeJS 20.4 bug
16
- // https://github.com/nodejs/node/issues/48699
17
- // and incorrect descriptor from some transpilers and userland helpers
18
- if (descriptor.enumerable && descriptor.configurable && descriptor.writable) {
19
- defineProperty(Symbol, 'dispose', { value: descriptor.value, enumerable: false, configurable: false, writable: false });
20
- }
21
- }
2
+ // TODO: Remove from `core-js@4`
3
+ require('../modules/es.symbol.dispose');
@@ -6,9 +6,17 @@ var $fromBase64 = require('../internals/uint8-from-base64');
6
6
 
7
7
  var Uint8Array = globalThis.Uint8Array;
8
8
 
9
+ var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.fromBase64 || !function () {
10
+ try {
11
+ Uint8Array.fromBase64('', null);
12
+ } catch (error) {
13
+ return true;
14
+ }
15
+ }();
16
+
9
17
  // `Uint8Array.fromBase64` method
10
18
  // https://github.com/tc39/proposal-arraybuffer-base64
11
- if (Uint8Array) $({ target: 'Uint8Array', stat: true }, {
19
+ if (Uint8Array) $({ target: 'Uint8Array', stat: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {
12
20
  fromBase64: function fromBase64(string /* , options */) {
13
21
  var result = $fromBase64(string, arguments.length > 1 ? arguments[1] : undefined, null, 0x1FFFFFFFFFFFFF);
14
22
  return arrayFromConstructorAndList(Uint8Array, result.bytes);
@@ -6,14 +6,18 @@ var anUint8Array = require('../internals/an-uint8-array');
6
6
 
7
7
  var Uint8Array = globalThis.Uint8Array;
8
8
 
9
- var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.setFromBase64 || !(function () {
9
+ var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.setFromBase64 || !function () {
10
10
  var target = new Uint8Array([255, 255, 255, 255, 255]);
11
+ try {
12
+ target.setFromBase64('', null);
13
+ return;
14
+ } catch (error) { /* empty */ }
11
15
  try {
12
16
  target.setFromBase64('MjYyZg===');
13
17
  } catch (error) {
14
18
  return target[0] === 50 && target[1] === 54 && target[2] === 50 && target[3] === 255 && target[4] === 255;
15
19
  }
16
- })();
20
+ }();
17
21
 
18
22
  // `Uint8Array.prototype.setFromBase64` method
19
23
  // https://github.com/tc39/proposal-arraybuffer-base64
@@ -13,9 +13,20 @@ var base64UrlAlphabet = base64Map.i2cUrl;
13
13
 
14
14
  var charAt = uncurryThis(''.charAt);
15
15
 
16
+ var Uint8Array = globalThis.Uint8Array;
17
+
18
+ var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.toBase64 || !function () {
19
+ try {
20
+ var target = new Uint8Array();
21
+ target.toBase64(null);
22
+ } catch (error) {
23
+ return true;
24
+ }
25
+ }();
26
+
16
27
  // `Uint8Array.prototype.toBase64` method
17
28
  // https://github.com/tc39/proposal-arraybuffer-base64
18
- if (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true }, {
29
+ if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {
19
30
  toBase64: function toBase64(/* options */) {
20
31
  var array = anUint8Array(this);
21
32
  var options = arguments.length ? anObjectOrUndefined(arguments[0]) : undefined;
@@ -5,11 +5,22 @@ var uncurryThis = require('../internals/function-uncurry-this');
5
5
  var anUint8Array = require('../internals/an-uint8-array');
6
6
  var notDetached = require('../internals/array-buffer-not-detached');
7
7
 
8
- var numberToString = uncurryThis(1.0.toString);
8
+ var numberToString = uncurryThis(1.1.toString);
9
+
10
+ var Uint8Array = globalThis.Uint8Array;
11
+
12
+ var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.toHex || !(function () {
13
+ try {
14
+ var target = new Uint8Array([255, 255, 255, 255, 255, 255, 255, 255]);
15
+ return target.toHex() === 'ffffffffffffffff';
16
+ } catch (error) {
17
+ return false;
18
+ }
19
+ })();
9
20
 
10
21
  // `Uint8Array.prototype.toHex` method
11
22
  // https://github.com/tc39/proposal-arraybuffer-base64
12
- if (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true }, {
23
+ if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {
13
24
  toHex: function toHex() {
14
25
  anUint8Array(this);
15
26
  notDetached(this.buffer);
@@ -44,7 +44,7 @@ var setHas = SetHelpers.has;
44
44
  var objectKeys = getBuiltIn('Object', 'keys');
45
45
  var push = uncurryThis([].push);
46
46
  var thisBooleanValue = uncurryThis(true.valueOf);
47
- var thisNumberValue = uncurryThis(1.0.valueOf);
47
+ var thisNumberValue = uncurryThis(1.1.valueOf);
48
48
  var thisStringValue = uncurryThis(''.valueOf);
49
49
  var thisTimeValue = uncurryThis(Date.prototype.getTime);
50
50
  var PERFORMANCE_MARK = uid('structuredClone');
@@ -35,7 +35,7 @@ var pow = Math.pow;
35
35
  var charAt = uncurryThis(''.charAt);
36
36
  var exec = uncurryThis(/./.exec);
37
37
  var join = uncurryThis([].join);
38
- var numberToString = uncurryThis(1.0.toString);
38
+ var numberToString = uncurryThis(1.1.toString);
39
39
  var pop = uncurryThis([].pop);
40
40
  var push = uncurryThis([].push);
41
41
  var replace = uncurryThis(''.replace);
@@ -65,6 +65,7 @@ var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/;
65
65
  var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/;
66
66
  var TAB_AND_NEW_LINE = /[\t\n\r]/g;
67
67
  /* eslint-enable regexp/no-control-character -- safe */
68
+ // eslint-disable-next-line no-unassigned-vars -- expected `undefined` value
68
69
  var EOF;
69
70
 
70
71
  // https://url.spec.whatwg.org/#ipv4-number-parser
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js",
3
- "version": "3.42.0",
3
+ "version": "3.44.0",
4
4
  "type": "commonjs",
5
5
  "description": "Standard library",
6
6
  "keywords": [
@@ -1,4 +1,4 @@
1
1
  'use strict';
2
2
  // TODO: Remove from `core-js@4`
3
- // https://github.com/js-choi/proposal-function-un-this
3
+ // https://github.com/js-choi/proposal-function-demethodize
4
4
  require('../modules/esnext.function.un-this');
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+ // https://github.com/tc39/proposal-iterator-chunking
3
+ require('../modules/esnext.iterator.chunks');
4
+ require('../modules/esnext.iterator.windows');
5
+ require('../modules/esnext.iterator.sliding');
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ // https://github.com/tc39/proposal-joint-iteration
3
+ require('../modules/esnext.iterator.zip');
4
+ require('../modules/esnext.iterator.zip-keyed');
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+ // https://github.com/tc39/proposal-math-clamp
3
+ require('../modules/esnext.number.clamp');
@@ -1,3 +1,3 @@
1
1
  'use strict';
2
- // https://github.com/CanadaHonk/proposal-math-clamp
2
+ // https://github.com/tc39/proposal-math-clamp
3
3
  require('../modules/esnext.math.clamp');
@@ -1,3 +1,3 @@
1
1
  'use strict';
2
- // https://github.com/bathos/proposal-string-cooked
2
+ // https://github.com/tc39/proposal-string-cooked
3
3
  require('../modules/esnext.string.cooked');
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/array/from-async');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/async-disposable-stack/constructor');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/async-disposable-stack');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../es/async-iterator/async-dispose');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../es/async-iterator');
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/disposable-stack/constructor');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/disposable-stack');
3
+
4
+ module.exports = parent;