core-js 3.34.0 → 3.35.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 (51) hide show
  1. package/LICENSE +1 -1
  2. package/internals/a-data-view.js +9 -0
  3. package/internals/a-possible-prototype.js +2 -2
  4. package/internals/array-buffer.js +6 -9
  5. package/internals/array-sort.js +30 -33
  6. package/internals/collection-from.js +17 -24
  7. package/internals/collection-of.js +11 -3
  8. package/internals/collection-strong.js +1 -2
  9. package/internals/export.js +1 -1
  10. package/internals/fix-regexp-well-known-symbol-logic.js +5 -6
  11. package/internals/get-set-record.js +5 -10
  12. package/internals/is-callable.js +4 -4
  13. package/internals/is-constructor.js +1 -2
  14. package/internals/is-object.js +1 -6
  15. package/internals/is-possible-prototype.js +6 -0
  16. package/internals/make-built-in.js +1 -1
  17. package/internals/microtask.js +2 -4
  18. package/internals/object-get-own-property-names-external.js +1 -1
  19. package/internals/safe-get-built-in.js +13 -0
  20. package/internals/shared.js +3 -3
  21. package/internals/to-length.js +2 -1
  22. package/internals/typed-array-constructor.js +3 -12
  23. package/modules/es.array.push.js +1 -1
  24. package/modules/es.function.has-instance.js +2 -5
  25. package/modules/es.object.proto.js +4 -2
  26. package/modules/es.promise.reject.js +2 -2
  27. package/modules/es.regexp.dot-all.js +1 -1
  28. package/modules/es.regexp.to-string.js +1 -1
  29. package/modules/es.string.ends-with.js +1 -5
  30. package/modules/es.string.replace-all.js +2 -8
  31. package/modules/es.string.split.js +21 -67
  32. package/modules/es.string.starts-with.js +1 -5
  33. package/modules/es.symbol.constructor.js +1 -1
  34. package/modules/es.weak-map.constructor.js +3 -6
  35. package/modules/esnext.data-view.set-float16.js +2 -3
  36. package/modules/esnext.data-view.set-uint8-clamped.js +2 -3
  37. package/modules/esnext.map.from.js +3 -2
  38. package/modules/esnext.map.of.js +3 -2
  39. package/modules/esnext.set.from.js +3 -2
  40. package/modules/esnext.set.of.js +3 -2
  41. package/modules/esnext.string.dedent.js +1 -1
  42. package/modules/esnext.weak-map.from.js +3 -2
  43. package/modules/esnext.weak-map.of.js +3 -2
  44. package/modules/esnext.weak-set.from.js +3 -2
  45. package/modules/esnext.weak-set.of.js +3 -2
  46. package/modules/web.queue-microtask.js +1 -7
  47. package/modules/web.url-search-params.constructor.js +1 -9
  48. package/modules/web.url.constructor.js +1 -1
  49. package/package.json +1 -1
  50. package/internals/array-slice-simple.js +0 -18
  51. package/internals/document-all.js +0 -11
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2023 Denis Pushkarev
1
+ Copyright (c) 2014-2024 Denis Pushkarev
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
@@ -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
  },
@@ -32,7 +32,7 @@ module.exports = function (options, source) {
32
32
  } else if (STATIC) {
33
33
  target = global[TARGET] || defineGlobalProperty(TARGET, {});
34
34
  } else {
35
- target = (global[TARGET] || {}).prototype;
35
+ target = global[TARGET] && global[TARGET].prototype;
36
36
  }
37
37
  if (target) for (key in source) {
38
38
  sourceProperty = source[key];
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  // TODO: Remove from `core-js@4` since it's moved to entry points
3
3
  require('../modules/es.regexp.exec');
4
- var uncurryThis = require('../internals/function-uncurry-this-clause');
4
+ var call = require('../internals/function-call');
5
5
  var defineBuiltIn = require('../internals/define-built-in');
6
6
  var regexpExec = require('../internals/regexp-exec');
7
7
  var fails = require('../internals/fails');
@@ -15,7 +15,7 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
15
15
  var SYMBOL = wellKnownSymbol(KEY);
16
16
 
17
17
  var DELEGATES_TO_SYMBOL = !fails(function () {
18
- // String methods call symbol-named RegEp methods
18
+ // String methods call symbol-named RegExp methods
19
19
  var O = {};
20
20
  O[SYMBOL] = function () { return 7; };
21
21
  return ''[KEY](O) !== 7;
@@ -53,18 +53,17 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
53
53
  !DELEGATES_TO_EXEC ||
54
54
  FORCED
55
55
  ) {
56
- var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]);
56
+ var nativeRegExpMethod = /./[SYMBOL];
57
57
  var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
58
- var uncurriedNativeMethod = uncurryThis(nativeMethod);
59
58
  var $exec = regexp.exec;
60
59
  if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
61
60
  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
62
61
  // The native String method already delegates to @@method (this
63
62
  // polyfilled function), leasing to infinite recursion.
64
63
  // We avoid it by directly calling the native @@method method.
65
- return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
64
+ return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) };
66
65
  }
67
- return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
66
+ return { done: true, value: call(nativeMethod, str, regexp, arg2) };
68
67
  }
69
68
  return { done: false };
70
69
  });
@@ -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';
@@ -7,7 +7,6 @@ var getBuiltIn = require('../internals/get-built-in');
7
7
  var inspectSource = require('../internals/inspect-source');
8
8
 
9
9
  var noop = function () { /* empty */ };
10
- var empty = [];
11
10
  var construct = getBuiltIn('Reflect', 'construct');
12
11
  var constructorRegExp = /^\s*(?:class|function)\b/;
13
12
  var exec = uncurryThis(constructorRegExp.exec);
@@ -16,7 +15,7 @@ var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
16
15
  var isConstructorModern = function isConstructor(argument) {
17
16
  if (!isCallable(argument)) return false;
18
17
  try {
19
- construct(noop, empty, argument);
18
+ construct(noop, [], argument);
20
19
  return true;
21
20
  } catch (error) {
22
21
  return false;
@@ -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
+ };
@@ -25,7 +25,7 @@ var TEMPLATE = String(String).split('String');
25
25
 
26
26
  var makeBuiltIn = module.exports = function (value, name, options) {
27
27
  if (stringSlice($String(name), 0, 7) === 'Symbol(') {
28
- name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
28
+ name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
29
29
  }
30
30
  if (options && options.getter) name = 'get ' + name;
31
31
  if (options && options.setter) name = 'set ' + name;
@@ -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.1',
9
9
  mode: IS_PURE ? 'pure' : 'global',
10
- copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
11
- license: 'https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE',
10
+ copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
11
+ license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
12
12
  source: 'https://github.com/zloirock/core-js'
13
13
  });
@@ -6,5 +6,6 @@ var min = Math.min;
6
6
  // `ToLength` abstract operation
7
7
  // https://tc39.es/ecma262/#sec-tolength
8
8
  module.exports = function (argument) {
9
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
9
+ var len = toIntegerOrInfinity(argument);
10
+ return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
10
11
  };
@@ -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
  });
@@ -20,12 +20,6 @@ var replace = uncurryThis(''.replace);
20
20
  var stringSlice = uncurryThis(''.slice);
21
21
  var max = Math.max;
22
22
 
23
- var stringIndexOf = function (string, searchValue, fromIndex) {
24
- if (fromIndex > string.length) return -1;
25
- if (searchValue === '') return fromIndex;
26
- return indexOf(string, searchValue, fromIndex);
27
- };
28
-
29
23
  // `String.prototype.replaceAll` method
30
24
  // https://tc39.es/ecma262/#sec-string.prototype.replaceall
31
25
  $({ target: 'String', proto: true }, {
@@ -54,14 +48,14 @@ $({ target: 'String', proto: true }, {
54
48
  if (!functionalReplace) replaceValue = toString(replaceValue);
55
49
  searchLength = searchString.length;
56
50
  advanceBy = max(1, searchLength);
57
- position = stringIndexOf(string, searchString, 0);
51
+ position = indexOf(string, searchString);
58
52
  while (position !== -1) {
59
53
  replacement = functionalReplace
60
54
  ? toString(replaceValue(searchString, position, string))
61
55
  : getSubstitution(searchString, string, position, [], undefined, replaceValue);
62
56
  result += stringSlice(string, endOfLastMatch, position) + replacement;
63
57
  endOfLastMatch = position + searchLength;
64
- position = stringIndexOf(string, searchString, position + advanceBy);
58
+ position = position + advanceBy > string.length ? -1 : indexOf(string, searchString, position + advanceBy);
65
59
  }
66
60
  if (endOfLastMatch < string.length) {
67
61
  result += stringSlice(string, endOfLastMatch);
@@ -1,29 +1,23 @@
1
1
  'use strict';
2
- var apply = require('../internals/function-apply');
3
2
  var call = require('../internals/function-call');
4
3
  var uncurryThis = require('../internals/function-uncurry-this');
5
4
  var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');
6
5
  var anObject = require('../internals/an-object');
7
6
  var isNullOrUndefined = require('../internals/is-null-or-undefined');
8
- var isRegExp = require('../internals/is-regexp');
9
7
  var requireObjectCoercible = require('../internals/require-object-coercible');
10
8
  var speciesConstructor = require('../internals/species-constructor');
11
9
  var advanceStringIndex = require('../internals/advance-string-index');
12
10
  var toLength = require('../internals/to-length');
13
11
  var toString = require('../internals/to-string');
14
12
  var getMethod = require('../internals/get-method');
15
- var arraySlice = require('../internals/array-slice-simple');
16
- var callRegExpExec = require('../internals/regexp-exec-abstract');
17
- var regexpExec = require('../internals/regexp-exec');
13
+ var regExpExec = require('../internals/regexp-exec-abstract');
18
14
  var stickyHelpers = require('../internals/regexp-sticky-helpers');
19
15
  var fails = require('../internals/fails');
20
16
 
21
17
  var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
22
18
  var MAX_UINT32 = 0xFFFFFFFF;
23
19
  var min = Math.min;
24
- var $push = [].push;
25
- var exec = uncurryThis(/./.exec);
26
- var push = uncurryThis($push);
20
+ var push = uncurryThis([].push);
27
21
  var stringSlice = uncurryThis(''.slice);
28
22
 
29
23
  // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
@@ -37,60 +31,20 @@ var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
37
31
  return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
38
32
  });
39
33
 
34
+ var BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' ||
35
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
36
+ 'test'.split(/(?:)/, -1).length !== 4 ||
37
+ 'ab'.split(/(?:ab)*/).length !== 2 ||
38
+ '.'.split(/(.?)(.?)/).length !== 4 ||
39
+ // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
40
+ '.'.split(/()()/).length > 1 ||
41
+ ''.split(/.?/).length;
42
+
40
43
  // @@split logic
41
44
  fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
42
- var internalSplit;
43
- if (
44
- 'abbc'.split(/(b)*/)[1] === 'c' ||
45
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
46
- 'test'.split(/(?:)/, -1).length !== 4 ||
47
- 'ab'.split(/(?:ab)*/).length !== 2 ||
48
- '.'.split(/(.?)(.?)/).length !== 4 ||
49
- // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
50
- '.'.split(/()()/).length > 1 ||
51
- ''.split(/.?/).length
52
- ) {
53
- // based on es5-shim implementation, need to rework it
54
- internalSplit = function (separator, limit) {
55
- var string = toString(requireObjectCoercible(this));
56
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
57
- if (lim === 0) return [];
58
- if (separator === undefined) return [string];
59
- // If `separator` is not a regex, use native split
60
- if (!isRegExp(separator)) {
61
- return call(nativeSplit, string, separator, lim);
62
- }
63
- var output = [];
64
- var flags = (separator.ignoreCase ? 'i' : '') +
65
- (separator.multiline ? 'm' : '') +
66
- (separator.unicode ? 'u' : '') +
67
- (separator.sticky ? 'y' : '');
68
- var lastLastIndex = 0;
69
- // Make `global` and avoid `lastIndex` issues by working with a copy
70
- var separatorCopy = new RegExp(separator.source, flags + 'g');
71
- var match, lastIndex, lastLength;
72
- while (match = call(regexpExec, separatorCopy, string)) {
73
- lastIndex = separatorCopy.lastIndex;
74
- if (lastIndex > lastLastIndex) {
75
- push(output, stringSlice(string, lastLastIndex, match.index));
76
- if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));
77
- lastLength = match[0].length;
78
- lastLastIndex = lastIndex;
79
- if (output.length >= lim) break;
80
- }
81
- if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
82
- }
83
- if (lastLastIndex === string.length) {
84
- if (lastLength || !exec(separatorCopy, '')) push(output, '');
85
- } else push(output, stringSlice(string, lastLastIndex));
86
- return output.length > lim ? arraySlice(output, 0, lim) : output;
87
- };
88
- // Chakra, V8
89
- } else if ('0'.split(undefined, 0).length) {
90
- internalSplit = function (separator, limit) {
91
- return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
92
- };
93
- } else internalSplit = nativeSplit;
45
+ var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {
46
+ return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
47
+ } : nativeSplit;
94
48
 
95
49
  return [
96
50
  // `String.prototype.split` method
@@ -110,30 +64,30 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
110
64
  function (string, limit) {
111
65
  var rx = anObject(this);
112
66
  var S = toString(string);
113
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
114
67
 
115
- if (res.done) return res.value;
68
+ if (!BUGGY) {
69
+ var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
70
+ if (res.done) return res.value;
71
+ }
116
72
 
117
73
  var C = speciesConstructor(rx, RegExp);
118
-
119
74
  var unicodeMatching = rx.unicode;
120
75
  var flags = (rx.ignoreCase ? 'i' : '') +
121
76
  (rx.multiline ? 'm' : '') +
122
77
  (rx.unicode ? 'u' : '') +
123
78
  (UNSUPPORTED_Y ? 'g' : 'y');
124
-
125
79
  // ^(? + rx + ) is needed, in combination with some S slicing, to
126
80
  // simulate the 'y' flag.
127
81
  var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
128
82
  var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
129
83
  if (lim === 0) return [];
130
- if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
84
+ if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];
131
85
  var p = 0;
132
86
  var q = 0;
133
87
  var A = [];
134
88
  while (q < S.length) {
135
89
  splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
136
- var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
90
+ var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
137
91
  var e;
138
92
  if (
139
93
  z === null ||
@@ -154,4 +108,4 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
154
108
  return A;
155
109
  }
156
110
  ];
157
- }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
111
+ }, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
@@ -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.1",
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
- };