core-js-bundle 3.45.0 → 3.46.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.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2025 Denis Pushkarev
1
+ Copyright (c) 2014-2025 Denis Pushkarev, 2025 CoreJS Company
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  **I highly recommend reading this: [So, what's next?](https://github.com/zloirock/core-js/blob/master/docs/2023-02-14-so-whats-next.md)**
10
10
  ---
11
11
 
12
- > Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to 2023](https://github.com/zloirock/core-js#ecmascript): [promises](https://github.com/zloirock/core-js#ecmascript-promise), [symbols](https://github.com/zloirock/core-js#ecmascript-symbol), [collections](https://github.com/zloirock/core-js#ecmascript-collections), iterators, [typed arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays), many other features, [ECMAScript proposals](https://github.com/zloirock/core-js#ecmascript-proposals), [some cross-platform WHATWG / W3C features and proposals](#web-standards) like [`URL`](https://github.com/zloirock/core-js#url-and-urlsearchparams). You can load only required features or use it without global namespace pollution.
12
+ > Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to 2025](https://github.com/zloirock/core-js#ecmascript): [promises](https://github.com/zloirock/core-js#ecmascript-promise), [symbols](https://github.com/zloirock/core-js#ecmascript-symbol), [collections](https://github.com/zloirock/core-js#ecmascript-collections), iterators, [typed arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays), many other features, [ECMAScript proposals](https://github.com/zloirock/core-js#ecmascript-proposals), [some cross-platform WHATWG / W3C features and proposals](#web-standards) like [`URL`](https://github.com/zloirock/core-js#url-and-urlsearchparams). You can load only required features or use it without global namespace pollution.
13
13
 
14
14
  ## Raising funds
15
15
 
@@ -25,17 +25,17 @@
25
25
 
26
26
  ---
27
27
 
28
- [*Example of usage*](https://tinyurl.com/2mknex43):
28
+ [*Example of usage*](https://tinyurl.com/28zqjbun):
29
29
  ```js
30
30
  import 'core-js/actual';
31
31
 
32
- Promise.resolve(42).then(it => console.log(it)); // => 42
32
+ Promise.try(() => 42).then(it => console.log(it)); // => 42
33
33
 
34
34
  Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
35
35
 
36
36
  [1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
37
37
 
38
- (function * (i) { while (true) yield i++; })(1)
38
+ Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
39
39
  .drop(1).take(5)
40
40
  .filter(it => it % 2)
41
41
  .map(it => it ** 2)
@@ -53,13 +53,13 @@ import 'core-js/actual/array/from';
53
53
  import 'core-js/actual/array/flat-map';
54
54
  import 'core-js/actual/structured-clone';
55
55
 
56
- Promise.resolve(42).then(it => console.log(it)); // => 42
56
+ Promise.try(() => 42).then(it => console.log(it)); // => 42
57
57
 
58
58
  Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
59
59
 
60
60
  [1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
61
61
 
62
- (function * (i) { while (true) yield i++; })(1)
62
+ Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
63
63
  .drop(1).take(5)
64
64
  .filter(it => it % 2)
65
65
  .map(it => it ** 2)
@@ -77,13 +77,13 @@ import from from 'core-js-pure/actual/array/from';
77
77
  import flatMap from 'core-js-pure/actual/array/flat-map';
78
78
  import structuredClone from 'core-js-pure/actual/structured-clone';
79
79
 
80
- Promise.resolve(42).then(it => console.log(it)); // => 42
80
+ Promise.try(() => 42).then(it => console.log(it)); // => 42
81
81
 
82
82
  from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
83
83
 
84
84
  flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2]
85
85
 
86
- Iterator.from(function * (i) { while (true) yield i++; }(1))
86
+ Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
87
87
  .drop(1).take(5)
88
88
  .filter(it => it % 2)
89
89
  .map(it => it ** 2)
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * core-js 3.45.0
2
+ * core-js 3.46.0
3
3
  * © 2014-2025 Denis Pushkarev (zloirock.ru)
4
- * license: https://github.com/zloirock/core-js/blob/v3.45.0/LICENSE
4
+ * license: https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE
5
5
  * source: https://github.com/zloirock/core-js
6
6
  */
7
7
  !function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap
@@ -1504,10 +1504,10 @@ var SHARED = '__core-js_shared__';
1504
1504
  var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
1505
1505
 
1506
1506
  (store.versions || (store.versions = [])).push({
1507
- version: '3.45.0',
1507
+ version: '3.46.0',
1508
1508
  mode: IS_PURE ? 'pure' : 'global',
1509
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
1510
- license: 'https://github.com/zloirock/core-js/blob/v3.45.0/LICENSE',
1509
+ copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)',
1510
+ license: 'https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE',
1511
1511
  source: 'https://github.com/zloirock/core-js'
1512
1512
  });
1513
1513
 
@@ -11627,6 +11627,7 @@ $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PR
11627
11627
  "use strict";
11628
11628
 
11629
11629
  var $ = __webpack_require__(3);
11630
+ var createProperty = __webpack_require__(145);
11630
11631
  var getBuiltIn = __webpack_require__(23);
11631
11632
  var uncurryThis = __webpack_require__(14);
11632
11633
  var aCallable = __webpack_require__(30);
@@ -11660,7 +11661,7 @@ $({ target: 'Object', stat: true, forced: DOES_NOT_WORK_WITH_PRIMITIVES }, {
11660
11661
  // in some IE versions, `hasOwnProperty` returns incorrect result on integer keys
11661
11662
  // but since it's a `null` prototype object, we can safely use `in`
11662
11663
  if (key in obj) push(obj[key], value);
11663
- else obj[key] = [value];
11664
+ else createProperty(obj, key, [value]);
11664
11665
  });
11665
11666
  return obj;
11666
11667
  }
@@ -21421,7 +21422,7 @@ var iteratorWindow = __webpack_require__(638);
21421
21422
  // https://github.com/tc39/proposal-iterator-chunking
21422
21423
  $({ target: 'Iterator', proto: true, real: true, forced: true }, {
21423
21424
  sliding: function sliding(windowSize) {
21424
- return iteratorWindow(this, windowSize, true);
21425
+ return iteratorWindow(this, windowSize, 'allow-partial');
21425
21426
  }
21426
21427
  });
21427
21428
 
@@ -21441,20 +21442,22 @@ var iteratorClose = __webpack_require__(138);
21441
21442
  var uncurryThis = __webpack_require__(14);
21442
21443
 
21443
21444
  var $RangeError = RangeError;
21445
+ var $TypeError = TypeError;
21444
21446
  var push = uncurryThis([].push);
21445
21447
  var slice = uncurryThis([].slice);
21448
+ var ALLOW_PARTIAL = 'allow-partial';
21446
21449
 
21447
21450
  var IteratorProxy = createIteratorProxy(function () {
21448
21451
  var iterator = this.iterator;
21449
21452
  var next = this.next;
21450
21453
  var buffer = this.buffer;
21451
21454
  var windowSize = this.windowSize;
21452
- var sliding = this.sliding;
21455
+ var allowPartial = this.allowPartial;
21453
21456
  var result, done;
21454
21457
  while (true) {
21455
21458
  result = anObject(call(next, iterator));
21456
21459
  done = this.done = !!result.done;
21457
- if (sliding && done && buffer.length && buffer.length < windowSize) return createIterResultObject(buffer, false);
21460
+ if (allowPartial && done && buffer.length && buffer.length < windowSize) return createIterResultObject(buffer, false);
21458
21461
  if (done) return createIterResultObject(undefined, true);
21459
21462
 
21460
21463
  if (buffer.length === windowSize) this.buffer = buffer = slice(buffer, 1);
@@ -21463,17 +21466,20 @@ var IteratorProxy = createIteratorProxy(function () {
21463
21466
  }
21464
21467
  }, false, true);
21465
21468
 
21466
- // `Iterator.prototype.sliding` and `Iterator.prototype.windows` methods
21469
+ // `Iterator.prototype.windows` and obsolete `Iterator.prototype.sliding` methods
21467
21470
  // https://github.com/tc39/proposal-iterator-chunking
21468
- module.exports = function (O, windowSize, sliding) {
21471
+ module.exports = function (O, windowSize, undersized) {
21469
21472
  anObject(O);
21470
21473
  if (typeof windowSize != 'number' || !windowSize || windowSize >>> 0 !== windowSize) {
21471
- return iteratorClose(O, 'throw', new $RangeError('windowSize must be integer in [1, 2^32-1]'));
21474
+ return iteratorClose(O, 'throw', new $RangeError('`windowSize` must be integer in [1, 2^32-1]'));
21475
+ }
21476
+ if (undersized !== undefined && undersized !== 'only-full' && undersized !== ALLOW_PARTIAL) {
21477
+ return iteratorClose(O, 'throw', new $TypeError('Incorrect `undersized` argument'));
21472
21478
  }
21473
21479
  return new IteratorProxy(getIteratorDirect(O), {
21474
21480
  windowSize: windowSize,
21475
21481
  buffer: [],
21476
- sliding: sliding
21482
+ allowPartial: undersized === ALLOW_PARTIAL
21477
21483
  });
21478
21484
  };
21479
21485
 
@@ -21511,8 +21517,8 @@ var iteratorWindow = __webpack_require__(638);
21511
21517
  // `Iterator.prototype.windows` method
21512
21518
  // https://github.com/tc39/proposal-iterator-chunking
21513
21519
  $({ target: 'Iterator', proto: true, real: true, forced: true }, {
21514
- windows: function windows(windowSize) {
21515
- return iteratorWindow(this, windowSize, false);
21520
+ windows: function windows(windowSize /* , undersized */) {
21521
+ return iteratorWindow(this, windowSize, arguments.length < 2 ? undefined : arguments[1]);
21516
21522
  }
21517
21523
  });
21518
21524
 
@@ -21679,7 +21685,7 @@ var IteratorProxy = createIteratorProxy(function () {
21679
21685
  for (var i = 0; i < iterCount; i++) {
21680
21686
  var iter = iters[i];
21681
21687
  if (iter === null) {
21682
- push(results, padding[i]);
21688
+ result = padding[i];
21683
21689
  } else {
21684
21690
  try {
21685
21691
  result = call(iter.next, iter.iterator);
@@ -21760,6 +21766,7 @@ module.exports = function (iters, mode, padding, finishResults) {
21760
21766
  var $ = __webpack_require__(3);
21761
21767
  var anObject = __webpack_require__(46);
21762
21768
  var anObjectOrUndefined = __webpack_require__(568);
21769
+ var createProperty = __webpack_require__(145);
21763
21770
  var call = __webpack_require__(8);
21764
21771
  var uncurryThis = __webpack_require__(14);
21765
21772
  var getBuiltIn = __webpack_require__(23);
@@ -21820,7 +21827,7 @@ $({ target: 'Iterator', stat: true, forced: true }, {
21820
21827
  return iteratorZip(iters, mode, padding, function (results) {
21821
21828
  var obj = create(null);
21822
21829
  for (var j = 0; j < iterCount; j++) {
21823
- obj[keys[j]] = results[j];
21830
+ createProperty(obj, keys[j], results[j]);
21824
21831
  }
21825
21832
  return obj;
21826
21833
  });
@@ -22529,6 +22536,7 @@ module.exports = function (C, adder, ENTRY) {
22529
22536
  var $ = __webpack_require__(3);
22530
22537
  var aMap = __webpack_require__(653);
22531
22538
  var MapHelpers = __webpack_require__(293);
22539
+ var IS_PURE = __webpack_require__(36);
22532
22540
 
22533
22541
  var get = MapHelpers.get;
22534
22542
  var has = MapHelpers.has;
@@ -22536,7 +22544,7 @@ var set = MapHelpers.set;
22536
22544
 
22537
22545
  // `Map.prototype.getOrInsert` method
22538
22546
  // https://github.com/tc39/proposal-upsert
22539
- $({ target: 'Map', proto: true, real: true }, {
22547
+ $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
22540
22548
  getOrInsert: function getOrInsert(key, value) {
22541
22549
  if (has(aMap(this), key)) return get(this, key);
22542
22550
  set(this, key, value);
@@ -22555,6 +22563,7 @@ var $ = __webpack_require__(3);
22555
22563
  var aCallable = __webpack_require__(30);
22556
22564
  var aMap = __webpack_require__(653);
22557
22565
  var MapHelpers = __webpack_require__(293);
22566
+ var IS_PURE = __webpack_require__(36);
22558
22567
 
22559
22568
  var get = MapHelpers.get;
22560
22569
  var has = MapHelpers.has;
@@ -22562,7 +22571,7 @@ var set = MapHelpers.set;
22562
22571
 
22563
22572
  // `Map.prototype.getOrInsertComputed` method
22564
22573
  // https://github.com/tc39/proposal-upsert
22565
- $({ target: 'Map', proto: true, real: true }, {
22574
+ $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
22566
22575
  getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
22567
22576
  aMap(this);
22568
22577
  aCallable(callbackfn);
@@ -25499,6 +25508,7 @@ $({ target: 'WeakMap', proto: true, real: true, forced: true }, {
25499
25508
  var $ = __webpack_require__(3);
25500
25509
  var aWeakMap = __webpack_require__(762);
25501
25510
  var WeakMapHelpers = __webpack_require__(740);
25511
+ var IS_PURE = __webpack_require__(36);
25502
25512
 
25503
25513
  var get = WeakMapHelpers.get;
25504
25514
  var has = WeakMapHelpers.has;
@@ -25506,7 +25516,7 @@ var set = WeakMapHelpers.set;
25506
25516
 
25507
25517
  // `WeakMap.prototype.getOrInsert` method
25508
25518
  // https://github.com/tc39/proposal-upsert
25509
- $({ target: 'WeakMap', proto: true, real: true }, {
25519
+ $({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, {
25510
25520
  getOrInsert: function getOrInsert(key, value) {
25511
25521
  if (has(aWeakMap(this), key)) return get(this, key);
25512
25522
  set(this, key, value);
@@ -25526,14 +25536,26 @@ var aCallable = __webpack_require__(30);
25526
25536
  var aWeakMap = __webpack_require__(762);
25527
25537
  var aWeakKey = __webpack_require__(768);
25528
25538
  var WeakMapHelpers = __webpack_require__(740);
25539
+ var IS_PURE = __webpack_require__(36);
25529
25540
 
25530
25541
  var get = WeakMapHelpers.get;
25531
25542
  var has = WeakMapHelpers.has;
25532
25543
  var set = WeakMapHelpers.set;
25533
25544
 
25545
+ var FORCED = IS_PURE || !function () {
25546
+ try {
25547
+ // eslint-disable-next-line es/no-weak-map, no-throw-literal -- testing
25548
+ if (WeakMap.prototype.getOrInsertComputed) new WeakMap().getOrInsertComputed(1, function () { throw 1; });
25549
+ } catch (error) {
25550
+ // FF144 Nightly - Beta 3 bug
25551
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1988369
25552
+ return error instanceof TypeError;
25553
+ }
25554
+ }();
25555
+
25534
25556
  // `WeakMap.prototype.getOrInsertComputed` method
25535
25557
  // https://github.com/tc39/proposal-upsert
25536
- $({ target: 'WeakMap', proto: true, real: true }, {
25558
+ $({ target: 'WeakMap', proto: true, real: true, forced: FORCED }, {
25537
25559
  getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
25538
25560
  aWeakMap(this);
25539
25561
  aWeakKey(key);