core-js 3.34.0 → 3.35.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 (44) hide show
  1. package/internals/a-data-view.js +9 -0
  2. package/internals/a-possible-prototype.js +2 -2
  3. package/internals/array-buffer.js +6 -9
  4. package/internals/array-sort.js +30 -33
  5. package/internals/collection-from.js +17 -24
  6. package/internals/collection-of.js +11 -3
  7. package/internals/collection-strong.js +1 -2
  8. package/internals/get-set-record.js +5 -10
  9. package/internals/is-callable.js +4 -4
  10. package/internals/is-object.js +1 -6
  11. package/internals/is-possible-prototype.js +6 -0
  12. package/internals/microtask.js +2 -4
  13. package/internals/object-get-own-property-names-external.js +1 -1
  14. package/internals/safe-get-built-in.js +13 -0
  15. package/internals/shared.js +2 -2
  16. package/internals/typed-array-constructor.js +3 -12
  17. package/modules/es.array.push.js +1 -1
  18. package/modules/es.function.has-instance.js +2 -5
  19. package/modules/es.object.proto.js +4 -2
  20. package/modules/es.promise.reject.js +2 -2
  21. package/modules/es.regexp.dot-all.js +1 -1
  22. package/modules/es.regexp.to-string.js +1 -1
  23. package/modules/es.string.ends-with.js +1 -5
  24. package/modules/es.string.split.js +1 -1
  25. package/modules/es.string.starts-with.js +1 -5
  26. package/modules/es.symbol.constructor.js +1 -1
  27. package/modules/es.weak-map.constructor.js +3 -6
  28. package/modules/esnext.data-view.set-float16.js +2 -3
  29. package/modules/esnext.data-view.set-uint8-clamped.js +2 -3
  30. package/modules/esnext.map.from.js +3 -2
  31. package/modules/esnext.map.of.js +3 -2
  32. package/modules/esnext.set.from.js +3 -2
  33. package/modules/esnext.set.of.js +3 -2
  34. package/modules/esnext.string.dedent.js +1 -1
  35. package/modules/esnext.weak-map.from.js +3 -2
  36. package/modules/esnext.weak-map.of.js +3 -2
  37. package/modules/esnext.weak-set.from.js +3 -2
  38. package/modules/esnext.weak-set.of.js +3 -2
  39. package/modules/web.queue-microtask.js +1 -7
  40. package/modules/web.url-search-params.constructor.js +1 -9
  41. package/modules/web.url.constructor.js +1 -1
  42. package/package.json +1 -1
  43. package/internals/array-slice-simple.js +0 -18
  44. package/internals/document-all.js +0 -11
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+ var classof = require('../internals/classof');
3
+
4
+ var $TypeError = TypeError;
5
+
6
+ module.exports = function (argument) {
7
+ if (classof(argument) === 'DataView') return argument;
8
+ throw new $TypeError('Argument is not a DataView');
9
+ };
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
- var isCallable = require('../internals/is-callable');
2
+ var isPossiblePrototype = require('../internals/is-possible-prototype');
3
3
 
4
4
  var $String = String;
5
5
  var $TypeError = TypeError;
6
6
 
7
7
  module.exports = function (argument) {
8
- if (typeof argument == 'object' || isCallable(argument)) return argument;
8
+ if (isPossiblePrototype(argument)) return argument;
9
9
  throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
10
10
  };
@@ -16,9 +16,10 @@ var fround = require('../internals/math-fround');
16
16
  var IEEE754 = require('../internals/ieee754');
17
17
  var getPrototypeOf = require('../internals/object-get-prototype-of');
18
18
  var setPrototypeOf = require('../internals/object-set-prototype-of');
19
- var getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
20
19
  var arrayFill = require('../internals/array-fill');
21
- var arraySlice = require('../internals/array-slice-simple');
20
+ var arraySlice = require('../internals/array-slice');
21
+ var inheritIfRequired = require('../internals/inherit-if-required');
22
+ var copyConstructorProperties = require('../internals/copy-constructor-properties');
22
23
  var setToStringTag = require('../internals/set-to-string-tag');
23
24
  var InternalStateModule = require('../internals/internal-state');
24
25
 
@@ -218,18 +219,14 @@ if (!NATIVE_ARRAY_BUFFER) {
218
219
  /* eslint-enable no-new -- required for testing */
219
220
  $ArrayBuffer = function ArrayBuffer(length) {
220
221
  anInstance(this, ArrayBufferPrototype);
221
- return new NativeArrayBuffer(toIndex(length));
222
+ return inheritIfRequired(new NativeArrayBuffer(toIndex(length)), this, $ArrayBuffer);
222
223
  };
223
224
 
224
225
  $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
225
226
 
226
- for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {
227
- if (!((key = keys[j++]) in $ArrayBuffer)) {
228
- createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);
229
- }
230
- }
231
-
232
227
  ArrayBufferPrototype.constructor = $ArrayBuffer;
228
+
229
+ copyConstructorProperties($ArrayBuffer, NativeArrayBuffer);
233
230
  } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
234
231
  createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER);
235
232
  }
@@ -1,45 +1,42 @@
1
1
  'use strict';
2
- var arraySlice = require('../internals/array-slice-simple');
2
+ var arraySlice = require('../internals/array-slice');
3
3
 
4
4
  var floor = Math.floor;
5
5
 
6
- var mergeSort = function (array, comparefn) {
6
+ var sort = function (array, comparefn) {
7
7
  var length = array.length;
8
- var middle = floor(length / 2);
9
- return length < 8 ? insertionSort(array, comparefn) : merge(
10
- array,
11
- mergeSort(arraySlice(array, 0, middle), comparefn),
12
- mergeSort(arraySlice(array, middle), comparefn),
13
- comparefn
14
- );
15
- };
16
8
 
17
- var insertionSort = function (array, comparefn) {
18
- var length = array.length;
19
- var i = 1;
20
- var element, j;
9
+ if (length < 8) {
10
+ // insertion sort
11
+ var i = 1;
12
+ var element, j;
21
13
 
22
- while (i < length) {
23
- j = i;
24
- element = array[i];
25
- while (j && comparefn(array[j - 1], element) > 0) {
26
- array[j] = array[--j];
14
+ while (i < length) {
15
+ j = i;
16
+ element = array[i];
17
+ while (j && comparefn(array[j - 1], element) > 0) {
18
+ array[j] = array[--j];
19
+ }
20
+ if (j !== i++) array[j] = element;
27
21
  }
28
- if (j !== i++) array[j] = element;
29
- } return array;
30
- };
22
+ } else {
23
+ // merge sort
24
+ var middle = floor(length / 2);
25
+ var left = sort(arraySlice(array, 0, middle), comparefn);
26
+ var right = sort(arraySlice(array, middle), comparefn);
27
+ var llength = left.length;
28
+ var rlength = right.length;
29
+ var lindex = 0;
30
+ var rindex = 0;
31
31
 
32
- var merge = function (array, left, right, comparefn) {
33
- var llength = left.length;
34
- var rlength = right.length;
35
- var lindex = 0;
36
- var rindex = 0;
32
+ while (lindex < llength || rindex < rlength) {
33
+ array[lindex + rindex] = (lindex < llength && rindex < rlength)
34
+ ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
35
+ : lindex < llength ? left[lindex++] : right[rindex++];
36
+ }
37
+ }
37
38
 
38
- while (lindex < llength || rindex < rlength) {
39
- array[lindex + rindex] = (lindex < llength && rindex < rlength)
40
- ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
41
- : lindex < llength ? left[lindex++] : right[rindex++];
42
- } return array;
39
+ return array;
43
40
  };
44
41
 
45
- module.exports = mergeSort;
42
+ module.exports = sort;
@@ -1,31 +1,24 @@
1
1
  'use strict';
2
2
  // https://tc39.github.io/proposal-setmap-offrom/
3
3
  var bind = require('../internals/function-bind-context');
4
- var call = require('../internals/function-call');
5
- var aCallable = require('../internals/a-callable');
6
- var aConstructor = require('../internals/a-constructor');
7
- var isNullOrUndefined = require('../internals/is-null-or-undefined');
4
+ var anObject = require('../internals/an-object');
5
+ var toObject = require('../internals/to-object');
8
6
  var iterate = require('../internals/iterate');
9
7
 
10
- var push = [].push;
11
-
12
- module.exports = function from(source /* , mapFn, thisArg */) {
13
- var length = arguments.length;
14
- var mapFn = length > 1 ? arguments[1] : undefined;
15
- var mapping, array, n, boundFunction;
16
- aConstructor(this);
17
- mapping = mapFn !== undefined;
18
- if (mapping) aCallable(mapFn);
19
- if (isNullOrUndefined(source)) return new this();
20
- array = [];
21
- if (mapping) {
22
- n = 0;
23
- boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined);
24
- iterate(source, function (nextItem) {
25
- call(push, array, boundFunction(nextItem, n++));
8
+ module.exports = function (C, adder, ENTRY) {
9
+ return function from(source /* , mapFn, thisArg */) {
10
+ var O = toObject(source);
11
+ var length = arguments.length;
12
+ var mapFn = length > 1 ? arguments[1] : undefined;
13
+ var mapping = mapFn !== undefined;
14
+ var boundFunction = mapping ? bind(mapFn, length > 2 ? arguments[2] : undefined) : undefined;
15
+ var result = new C();
16
+ var n = 0;
17
+ iterate(O, function (nextItem) {
18
+ var entry = mapping ? boundFunction(nextItem, n++) : nextItem;
19
+ if (ENTRY) adder(result, anObject(entry)[0], entry[1]);
20
+ else adder(result, entry);
26
21
  });
27
- } else {
28
- iterate(source, push, { that: array });
29
- }
30
- return new this(array);
22
+ return result;
23
+ };
31
24
  };
@@ -1,7 +1,15 @@
1
1
  'use strict';
2
- var arraySlice = require('../internals/array-slice');
2
+ var anObject = require('../internals/an-object');
3
3
 
4
4
  // https://tc39.github.io/proposal-setmap-offrom/
5
- module.exports = function of() {
6
- return new this(arraySlice(arguments));
5
+ module.exports = function (C, adder, ENTRY) {
6
+ return function of() {
7
+ var result = new C();
8
+ var length = arguments.length;
9
+ for (var index = 0; index < length; index++) {
10
+ var entry = arguments[index];
11
+ if (ENTRY) adder(result, anObject(entry)[0], entry[1]);
12
+ else adder(result, entry);
13
+ } return result;
14
+ };
7
15
  };
@@ -80,15 +80,14 @@ module.exports = {
80
80
  clear: function clear() {
81
81
  var that = this;
82
82
  var state = getInternalState(that);
83
- var data = state.index;
84
83
  var entry = state.first;
85
84
  while (entry) {
86
85
  entry.removed = true;
87
86
  if (entry.previous) entry.previous = entry.previous.next = undefined;
88
- delete data[entry.index];
89
87
  entry = entry.next;
90
88
  }
91
89
  state.first = state.last = undefined;
90
+ state.index = create(null);
92
91
  if (DESCRIPTORS) state.size = 0;
93
92
  else that.size = 0;
94
93
  },
@@ -10,11 +10,11 @@ var $RangeError = RangeError;
10
10
  var $TypeError = TypeError;
11
11
  var max = Math.max;
12
12
 
13
- var SetRecord = function (set, size, has, keys) {
13
+ var SetRecord = function (set, intSize) {
14
14
  this.set = set;
15
- this.size = size;
16
- this.has = has;
17
- this.keys = keys;
15
+ this.size = max(intSize, 0);
16
+ this.has = aCallable(set.has);
17
+ this.keys = aCallable(set.keys);
18
18
  };
19
19
 
20
20
  SetRecord.prototype = {
@@ -36,10 +36,5 @@ module.exports = function (obj) {
36
36
  if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
37
37
  var intSize = toIntegerOrInfinity(numSize);
38
38
  if (intSize < 0) throw new $RangeError(INVALID_SIZE);
39
- return new SetRecord(
40
- obj,
41
- max(intSize, 0),
42
- aCallable(obj.has),
43
- aCallable(obj.keys)
44
- );
39
+ return new SetRecord(obj, intSize);
45
40
  };
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
- var $documentAll = require('../internals/document-all');
3
-
4
- var documentAll = $documentAll.all;
2
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
3
+ var documentAll = typeof document == 'object' && document.all;
5
4
 
6
5
  // `IsCallable` abstract operation
7
6
  // https://tc39.es/ecma262/#sec-iscallable
8
- module.exports = $documentAll.IS_HTMLDDA ? function (argument) {
7
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
8
+ module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
9
9
  return typeof argument == 'function' || argument === documentAll;
10
10
  } : function (argument) {
11
11
  return typeof argument == 'function';
@@ -1,11 +1,6 @@
1
1
  'use strict';
2
2
  var isCallable = require('../internals/is-callable');
3
- var $documentAll = require('../internals/document-all');
4
3
 
5
- var documentAll = $documentAll.all;
6
-
7
- module.exports = $documentAll.IS_HTMLDDA ? function (it) {
8
- return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;
9
- } : function (it) {
4
+ module.exports = function (it) {
10
5
  return typeof it == 'object' ? it !== null : isCallable(it);
11
6
  };
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+ var isObject = require('../internals/is-object');
3
+
4
+ module.exports = function (argument) {
5
+ return isObject(argument) || argument === null;
6
+ };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var global = require('../internals/global');
3
+ var safeGetBuiltIn = require('../internals/safe-get-built-in');
3
4
  var bind = require('../internals/function-bind-context');
4
- var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
5
5
  var macrotask = require('../internals/task').set;
6
6
  var Queue = require('../internals/queue');
7
7
  var IS_IOS = require('../internals/engine-is-ios');
@@ -13,9 +13,7 @@ var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
13
13
  var document = global.document;
14
14
  var process = global.process;
15
15
  var Promise = global.Promise;
16
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
17
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
18
- var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
16
+ var microtask = safeGetBuiltIn('queueMicrotask');
19
17
  var notify, toggle, node, promise, then;
20
18
 
21
19
  // modern engines have queueMicrotask method
@@ -3,7 +3,7 @@
3
3
  var classof = require('../internals/classof-raw');
4
4
  var toIndexedObject = require('../internals/to-indexed-object');
5
5
  var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
6
- var arraySlice = require('../internals/array-slice-simple');
6
+ var arraySlice = require('../internals/array-slice');
7
7
 
8
8
  var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
9
9
  ? Object.getOwnPropertyNames(window) : [];
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+ var global = require('../internals/global');
3
+ var DESCRIPTORS = require('../internals/descriptors');
4
+
5
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
6
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
7
+
8
+ // Avoid NodeJS experimental warning
9
+ module.exports = function (name) {
10
+ if (!DESCRIPTORS) return global[name];
11
+ var descriptor = getOwnPropertyDescriptor(global, name);
12
+ return descriptor && descriptor.value;
13
+ };
@@ -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.34.0',
8
+ version: '3.35.0',
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.34.0/LICENSE',
11
+ license: 'https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE',
12
12
  source: 'https://github.com/zloirock/core-js'
13
13
  });
@@ -29,6 +29,7 @@ var setSpecies = require('../internals/set-species');
29
29
  var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
30
30
  var definePropertyModule = require('../internals/object-define-property');
31
31
  var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
32
+ var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
32
33
  var InternalStateModule = require('../internals/internal-state');
33
34
  var inheritIfRequired = require('../internals/inherit-if-required');
34
35
 
@@ -45,20 +46,10 @@ var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
45
46
  var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
46
47
  var TypedArray = ArrayBufferViewCore.TypedArray;
47
48
  var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
48
- var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
49
49
  var isTypedArray = ArrayBufferViewCore.isTypedArray;
50
50
  var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
51
51
  var WRONG_LENGTH = 'Wrong length';
52
52
 
53
- var fromList = function (C, list) {
54
- aTypedArrayConstructor(C);
55
- var index = 0;
56
- var length = list.length;
57
- var result = new C(length);
58
- while (length > index) result[index] = list[index++];
59
- return result;
60
- };
61
-
62
53
  var addGetter = function (it, key) {
63
54
  defineBuiltInAccessor(it, key, {
64
55
  configurable: true,
@@ -176,7 +167,7 @@ if (DESCRIPTORS) {
176
167
  }
177
168
  length = byteLength / BYTES;
178
169
  } else if (isTypedArray(data)) {
179
- return fromList(TypedArrayConstructor, data);
170
+ return arrayFromConstructorAndList(TypedArrayConstructor, data);
180
171
  } else {
181
172
  return call(typedArrayFrom, TypedArrayConstructor, data);
182
173
  }
@@ -202,7 +193,7 @@ if (DESCRIPTORS) {
202
193
  : typedArrayOffset !== undefined
203
194
  ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))
204
195
  : new NativeTypedArrayConstructor(data);
205
- if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);
196
+ if (isTypedArray(data)) return arrayFromConstructorAndList(TypedArrayConstructor, data);
206
197
  return call(typedArrayFrom, TypedArrayConstructor, data);
207
198
  }(), dummy, TypedArrayConstructor);
208
199
  });
@@ -10,7 +10,7 @@ var INCORRECT_TO_LENGTH = fails(function () {
10
10
  return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
11
11
  });
12
12
 
13
- // V8 and Safari <= 15.4, FF < 23 throws InternalError
13
+ // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
14
14
  // https://bugs.chromium.org/p/v8/issues/detail?id=12681
15
15
  var properErrorOnNonWritableLength = function () {
16
16
  try {
@@ -2,7 +2,7 @@
2
2
  var isCallable = require('../internals/is-callable');
3
3
  var isObject = require('../internals/is-object');
4
4
  var definePropertyModule = require('../internals/object-define-property');
5
- var getPrototypeOf = require('../internals/object-get-prototype-of');
5
+ var isPrototypeOf = require('../internals/object-is-prototype-of');
6
6
  var wellKnownSymbol = require('../internals/well-known-symbol');
7
7
  var makeBuiltIn = require('../internals/make-built-in');
8
8
 
@@ -15,9 +15,6 @@ if (!(HAS_INSTANCE in FunctionPrototype)) {
15
15
  definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function (O) {
16
16
  if (!isCallable(this) || !isObject(O)) return false;
17
17
  var P = this.prototype;
18
- if (!isObject(P)) return O instanceof this;
19
- // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
20
- while (O = getPrototypeOf(O)) if (P === O) return true;
21
- return false;
18
+ return isObject(P) ? isPrototypeOf(P, O) : O instanceof this;
22
19
  }, HAS_INSTANCE) });
23
20
  }
@@ -2,6 +2,7 @@
2
2
  var DESCRIPTORS = require('../internals/descriptors');
3
3
  var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
4
4
  var isObject = require('../internals/is-object');
5
+ var isPossiblePrototype = require('../internals/is-possible-prototype');
5
6
  var toObject = require('../internals/to-object');
6
7
  var requireObjectCoercible = require('../internals/require-object-coercible');
7
8
 
@@ -22,8 +23,9 @@ if (DESCRIPTORS && getPrototypeOf && setPrototypeOf && !(PROTO in ObjectPrototyp
22
23
  },
23
24
  set: function __proto__(proto) {
24
25
  var O = requireObjectCoercible(this);
25
- if (!isObject(proto) && proto !== null || !isObject(O)) return;
26
- setPrototypeOf(O, proto);
26
+ if (isPossiblePrototype(proto) && isObject(O)) {
27
+ setPrototypeOf(O, proto);
28
+ }
27
29
  }
28
30
  });
29
31
  } catch (error) { /* empty */ }
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var call = require('../internals/function-call');
4
3
  var newPromiseCapabilityModule = require('../internals/new-promise-capability');
5
4
  var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;
6
5
 
@@ -9,7 +8,8 @@ var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detec
9
8
  $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
10
9
  reject: function reject(r) {
11
10
  var capability = newPromiseCapabilityModule.f(this);
12
- call(capability.reject, undefined, r);
11
+ var capabilityReject = capability.reject;
12
+ capabilityReject(r);
13
13
  return capability.promise;
14
14
  }
15
15
  });
@@ -14,7 +14,7 @@ if (DESCRIPTORS && UNSUPPORTED_DOT_ALL) {
14
14
  defineBuiltInAccessor(RegExpPrototype, 'dotAll', {
15
15
  configurable: true,
16
16
  get: function dotAll() {
17
- if (this === RegExpPrototype) return undefined;
17
+ if (this === RegExpPrototype) return;
18
18
  // We can't use InternalStateModule.getterFor because
19
19
  // we don't add metadata for regexps created by a literal.
20
20
  if (classof(this) === 'RegExp') {
@@ -17,7 +17,7 @@ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
17
17
  // `RegExp.prototype.toString` method
18
18
  // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
19
19
  if (NOT_GENERIC || INCORRECT_NAME) {
20
- defineBuiltIn(RegExp.prototype, TO_STRING, function toString() {
20
+ defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
21
21
  var R = anObject(this);
22
22
  var pattern = $toString(R.source);
23
23
  var flags = $toString(getRegExpFlags(R));
@@ -9,8 +9,6 @@ var requireObjectCoercible = require('../internals/require-object-coercible');
9
9
  var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');
10
10
  var IS_PURE = require('../internals/is-pure');
11
11
 
12
- // eslint-disable-next-line es/no-string-prototype-endswith -- safe
13
- var nativeEndsWith = uncurryThis(''.endsWith);
14
12
  var slice = uncurryThis(''.slice);
15
13
  var min = Math.min;
16
14
 
@@ -31,8 +29,6 @@ $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGE
31
29
  var len = that.length;
32
30
  var end = endPosition === undefined ? len : min(toLength(endPosition), len);
33
31
  var search = toString(searchString);
34
- return nativeEndsWith
35
- ? nativeEndsWith(that, search, end)
36
- : slice(that, end - search.length, end) === search;
32
+ return slice(that, end - search.length, end) === search;
37
33
  }
38
34
  });
@@ -12,7 +12,7 @@ var advanceStringIndex = require('../internals/advance-string-index');
12
12
  var toLength = require('../internals/to-length');
13
13
  var toString = require('../internals/to-string');
14
14
  var getMethod = require('../internals/get-method');
15
- var arraySlice = require('../internals/array-slice-simple');
15
+ var arraySlice = require('../internals/array-slice');
16
16
  var callRegExpExec = require('../internals/regexp-exec-abstract');
17
17
  var regexpExec = require('../internals/regexp-exec');
18
18
  var stickyHelpers = require('../internals/regexp-sticky-helpers');
@@ -9,8 +9,6 @@ var requireObjectCoercible = require('../internals/require-object-coercible');
9
9
  var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');
10
10
  var IS_PURE = require('../internals/is-pure');
11
11
 
12
- // eslint-disable-next-line es/no-string-prototype-startswith -- safe
13
- var nativeStartsWith = uncurryThis(''.startsWith);
14
12
  var stringSlice = uncurryThis(''.slice);
15
13
  var min = Math.min;
16
14
 
@@ -29,8 +27,6 @@ $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGE
29
27
  notARegExp(searchString);
30
28
  var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
31
29
  var search = toString(searchString);
32
- return nativeStartsWith
33
- ? nativeStartsWith(that, search, index)
34
- : stringSlice(that, index, index + search.length) === search;
30
+ return stringSlice(that, index, index + search.length) === search;
35
31
  }
36
32
  });
@@ -97,7 +97,7 @@ var $defineProperty = function defineProperty(O, P, Attributes) {
97
97
  anObject(Attributes);
98
98
  if (hasOwn(AllSymbols, key)) {
99
99
  if (!Attributes.enumerable) {
100
- if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
100
+ if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null)));
101
101
  O[HIDDEN][key] = true;
102
102
  } else {
103
103
  if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
@@ -25,8 +25,6 @@ var freeze = $Object.freeze;
25
25
  // eslint-disable-next-line es/no-object-seal -- safe
26
26
  var seal = $Object.seal;
27
27
 
28
- var FROZEN = {};
29
- var SEALED = {};
30
28
  var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
31
29
  var InternalWeakMap;
32
30
 
@@ -97,12 +95,11 @@ if (NATIVE_WEAK_MAP) if (IS_IE11) {
97
95
  set: function set(key, value) {
98
96
  var arrayIntegrityLevel;
99
97
  if (isArray(key)) {
100
- if (isFrozen(key)) arrayIntegrityLevel = FROZEN;
101
- else if (isSealed(key)) arrayIntegrityLevel = SEALED;
98
+ if (isFrozen(key)) arrayIntegrityLevel = freeze;
99
+ else if (isSealed(key)) arrayIntegrityLevel = seal;
102
100
  }
103
101
  nativeSet(this, key, value);
104
- if (arrayIntegrityLevel === FROZEN) freeze(key);
105
- if (arrayIntegrityLevel === SEALED) seal(key);
102
+ if (arrayIntegrityLevel) arrayIntegrityLevel(key);
106
103
  return this;
107
104
  }
108
105
  });
@@ -1,12 +1,11 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var uncurryThis = require('../internals/function-uncurry-this');
4
- var classof = require('../internals/classof');
4
+ var aDataView = require('../internals/a-data-view');
5
5
  var toIndex = require('../internals/to-index');
6
6
  var packIEEE754 = require('../internals/ieee754').pack;
7
7
  var f16round = require('../internals/math-f16round');
8
8
 
9
- var $TypeError = TypeError;
10
9
  // eslint-disable-next-line es/no-typed-arrays -- safe
11
10
  var setUint16 = uncurryThis(DataView.prototype.setUint16);
12
11
 
@@ -14,7 +13,7 @@ var setUint16 = uncurryThis(DataView.prototype.setUint16);
14
13
  // https://github.com/tc39/proposal-float16array
15
14
  $({ target: 'DataView', proto: true }, {
16
15
  setFloat16: function setFloat16(byteOffset, value /* , littleEndian */) {
17
- if (classof(this) !== 'DataView') throw new $TypeError('Incorrect receiver');
16
+ aDataView(this);
18
17
  var offset = toIndex(byteOffset);
19
18
  var bytes = packIEEE754(f16round(value), 10, 2);
20
19
  return setUint16(this, offset, bytes[1] << 8 | bytes[0], arguments.length > 2 ? arguments[2] : false);
@@ -1,11 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var uncurryThis = require('../internals/function-uncurry-this');
4
- var classof = require('../internals/classof');
4
+ var aDataView = require('../internals/a-data-view');
5
5
  var toIndex = require('../internals/to-index');
6
6
  var toUint8Clamped = require('../internals/to-uint8-clamped');
7
7
 
8
- var $TypeError = TypeError;
9
8
  // eslint-disable-next-line es/no-typed-arrays -- safe
10
9
  var setUint8 = uncurryThis(DataView.prototype.setUint8);
11
10
 
@@ -13,7 +12,7 @@ var setUint8 = uncurryThis(DataView.prototype.setUint8);
13
12
  // https://github.com/tc39/proposal-dataview-get-set-uint8clamped
14
13
  $({ target: 'DataView', proto: true, forced: true }, {
15
14
  setUint8Clamped: function setUint8Clamped(byteOffset, value) {
16
- if (classof(this) !== 'DataView') throw new $TypeError('Incorrect receiver');
15
+ aDataView(this);
17
16
  var offset = toIndex(byteOffset);
18
17
  return setUint8(this, offset, toUint8Clamped(value));
19
18
  }
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var from = require('../internals/collection-from');
3
+ var MapHelpers = require('../internals/map-helpers');
4
+ var createCollectionFrom = require('../internals/collection-from');
4
5
 
5
6
  // `Map.from` method
6
7
  // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
7
8
  $({ target: 'Map', stat: true, forced: true }, {
8
- from: from
9
+ from: createCollectionFrom(MapHelpers.Map, MapHelpers.set, true)
9
10
  });
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var of = require('../internals/collection-of');
3
+ var MapHelpers = require('../internals/map-helpers');
4
+ var createCollectionOf = require('../internals/collection-of');
4
5
 
5
6
  // `Map.of` method
6
7
  // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
7
8
  $({ target: 'Map', stat: true, forced: true }, {
8
- of: of
9
+ of: createCollectionOf(MapHelpers.Map, MapHelpers.set, true)
9
10
  });
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var from = require('../internals/collection-from');
3
+ var SetHelpers = require('../internals/set-helpers');
4
+ var createCollectionFrom = require('../internals/collection-from');
4
5
 
5
6
  // `Set.from` method
6
7
  // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
7
8
  $({ target: 'Set', stat: true, forced: true }, {
8
- from: from
9
+ from: createCollectionFrom(SetHelpers.Set, SetHelpers.add, false)
9
10
  });
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var of = require('../internals/collection-of');
3
+ var SetHelpers = require('../internals/set-helpers');
4
+ var createCollectionOf = require('../internals/collection-of');
4
5
 
5
6
  // `Set.of` method
6
7
  // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
7
8
  $({ target: 'Set', stat: true, forced: true }, {
8
- of: of
9
+ of: createCollectionOf(SetHelpers.Set, SetHelpers.add, false)
9
10
  });
@@ -9,7 +9,7 @@ var toObject = require('../internals/to-object');
9
9
  var isCallable = require('../internals/is-callable');
10
10
  var lengthOfArrayLike = require('../internals/length-of-array-like');
11
11
  var defineProperty = require('../internals/object-define-property').f;
12
- var createArrayFromList = require('../internals/array-slice-simple');
12
+ var createArrayFromList = require('../internals/array-slice');
13
13
  var WeakMapHelpers = require('../internals/weak-map-helpers');
14
14
  var cooked = require('../internals/string-cooked');
15
15
  var parse = require('../internals/string-parse');
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var from = require('../internals/collection-from');
3
+ var WeakMapHelpers = require('../internals/weak-map-helpers');
4
+ var createCollectionFrom = require('../internals/collection-from');
4
5
 
5
6
  // `WeakMap.from` method
6
7
  // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
7
8
  $({ target: 'WeakMap', stat: true, forced: true }, {
8
- from: from
9
+ from: createCollectionFrom(WeakMapHelpers.WeakMap, WeakMapHelpers.set, true)
9
10
  });
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var of = require('../internals/collection-of');
3
+ var WeakMapHelpers = require('../internals/weak-map-helpers');
4
+ var createCollectionOf = require('../internals/collection-of');
4
5
 
5
6
  // `WeakMap.of` method
6
7
  // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
7
8
  $({ target: 'WeakMap', stat: true, forced: true }, {
8
- of: of
9
+ of: createCollectionOf(WeakMapHelpers.WeakMap, WeakMapHelpers.set, true)
9
10
  });
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var from = require('../internals/collection-from');
3
+ var WeakSetHelpers = require('../internals/weak-set-helpers');
4
+ var createCollectionFrom = require('../internals/collection-from');
4
5
 
5
6
  // `WeakSet.from` method
6
7
  // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
7
8
  $({ target: 'WeakSet', stat: true, forced: true }, {
8
- from: from
9
+ from: createCollectionFrom(WeakSetHelpers.WeakSet, WeakSetHelpers.add, false)
9
10
  });
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var of = require('../internals/collection-of');
3
+ var WeakSetHelpers = require('../internals/weak-set-helpers');
4
+ var createCollectionOf = require('../internals/collection-of');
4
5
 
5
6
  // `WeakSet.of` method
6
7
  // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
7
8
  $({ target: 'WeakSet', stat: true, forced: true }, {
8
- of: of
9
+ of: createCollectionOf(WeakSetHelpers.WeakSet, WeakSetHelpers.add, false)
9
10
  });
@@ -1,20 +1,14 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var global = require('../internals/global');
4
3
  var microtask = require('../internals/microtask');
5
4
  var aCallable = require('../internals/a-callable');
6
5
  var validateArgumentsLength = require('../internals/validate-arguments-length');
7
- var IS_NODE = require('../internals/engine-is-node');
8
-
9
- var process = global.process;
10
6
 
11
7
  // `queueMicrotask` method
12
8
  // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
13
9
  $({ global: true, enumerable: true, dontCallGetSet: true }, {
14
10
  queueMicrotask: function queueMicrotask(fn) {
15
11
  validateArgumentsLength(arguments.length, 1);
16
- aCallable(fn);
17
- var domain = IS_NODE && process.domain;
18
- microtask(domain ? domain.bind(fn) : fn);
12
+ microtask(aCallable(fn));
19
13
  }
20
14
  });
@@ -3,6 +3,7 @@
3
3
  require('../modules/es.array.iterator');
4
4
  var $ = require('../internals/export');
5
5
  var global = require('../internals/global');
6
+ var safeGetBuiltIn = require('../internals/safe-get-built-in');
6
7
  var call = require('../internals/function-call');
7
8
  var uncurryThis = require('../internals/function-uncurry-this');
8
9
  var DESCRIPTORS = require('../internals/descriptors');
@@ -36,15 +37,6 @@ var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
36
37
  var setInternalState = InternalStateModule.set;
37
38
  var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
38
39
  var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
39
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
40
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
41
-
42
- // Avoid NodeJS experimental warning
43
- var safeGetBuiltIn = function (name) {
44
- if (!DESCRIPTORS) return global[name];
45
- var descriptor = getOwnPropertyDescriptor(global, name);
46
- return descriptor && descriptor.value;
47
- };
48
40
 
49
41
  var nativeFetch = safeGetBuiltIn('fetch');
50
42
  var NativeRequest = safeGetBuiltIn('Request');
@@ -13,7 +13,7 @@ var anInstance = require('../internals/an-instance');
13
13
  var hasOwn = require('../internals/has-own-property');
14
14
  var assign = require('../internals/object-assign');
15
15
  var arrayFrom = require('../internals/array-from');
16
- var arraySlice = require('../internals/array-slice-simple');
16
+ var arraySlice = require('../internals/array-slice');
17
17
  var codeAt = require('../internals/string-multibyte').codeAt;
18
18
  var toASCII = require('../internals/string-punycode-to-ascii');
19
19
  var $toString = require('../internals/to-string');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js",
3
- "version": "3.34.0",
3
+ "version": "3.35.0",
4
4
  "type": "commonjs",
5
5
  "description": "Standard library",
6
6
  "keywords": [
@@ -1,18 +0,0 @@
1
- 'use strict';
2
- var toAbsoluteIndex = require('../internals/to-absolute-index');
3
- var lengthOfArrayLike = require('../internals/length-of-array-like');
4
- var createProperty = require('../internals/create-property');
5
-
6
- var $Array = Array;
7
- var max = Math.max;
8
-
9
- module.exports = function (O, start, end) {
10
- var length = lengthOfArrayLike(O);
11
- var k = toAbsoluteIndex(start, length);
12
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
13
- var result = $Array(max(fin - k, 0));
14
- var n = 0;
15
- for (; k < fin; k++, n++) createProperty(result, n, O[k]);
16
- result.length = n;
17
- return result;
18
- };
@@ -1,11 +0,0 @@
1
- 'use strict';
2
- var documentAll = typeof document == 'object' && document.all;
3
-
4
- // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
5
- // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
6
- var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
7
-
8
- module.exports = {
9
- all: documentAll,
10
- IS_HTMLDDA: IS_HTMLDDA
11
- };