core-js 3.27.1 → 3.27.2

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 (52) hide show
  1. package/LICENSE +1 -1
  2. package/internals/async-iterator-create-proxy.js +8 -17
  3. package/internals/collection-weak.js +2 -2
  4. package/internals/engine-is-ios-pebble.js +1 -2
  5. package/internals/engine-is-node.js +1 -2
  6. package/internals/engine-user-agent.js +1 -3
  7. package/internals/error-stack-install.js +13 -0
  8. package/internals/get-set-record.js +2 -1
  9. package/internals/host-report-errors.js +3 -5
  10. package/internals/is-big-int-array.js +2 -4
  11. package/internals/iterator-create-proxy.js +9 -18
  12. package/internals/make-built-in.js +8 -3
  13. package/internals/microtask.js +20 -25
  14. package/internals/queue.js +4 -3
  15. package/internals/set-is-disjoint-from.js +8 -8
  16. package/internals/set-is-superset-of.js +4 -2
  17. package/internals/shared.js +3 -3
  18. package/internals/string-cooked.js +3 -0
  19. package/internals/string-punycode-to-ascii.js +0 -1
  20. package/internals/task.js +8 -8
  21. package/internals/well-known-symbol.js +6 -12
  22. package/internals/wrap-error-constructor-with-cause.js +2 -3
  23. package/modules/es.aggregate-error.constructor.js +3 -5
  24. package/modules/es.array.concat.js +1 -3
  25. package/modules/es.array.index-of.js +2 -2
  26. package/modules/es.array.join.js +2 -2
  27. package/modules/es.array.push.js +5 -3
  28. package/modules/es.array.reduce-right.js +2 -2
  29. package/modules/es.array.reduce.js +2 -2
  30. package/modules/es.array.unshift.js +5 -3
  31. package/modules/es.date.get-year.js +1 -0
  32. package/modules/es.error.cause.js +1 -0
  33. package/modules/es.math.asinh.js +3 -1
  34. package/modules/es.math.atanh.js +3 -1
  35. package/modules/es.math.cosh.js +3 -1
  36. package/modules/es.math.hypot.js +2 -2
  37. package/modules/es.number.to-exponential.js +14 -11
  38. package/modules/es.object.get-own-property-descriptor.js +1 -2
  39. package/modules/es.object.is-frozen.js +3 -2
  40. package/modules/es.object.is-sealed.js +3 -2
  41. package/modules/es.promise.all-settled.js +2 -1
  42. package/modules/es.promise.any.js +2 -1
  43. package/modules/es.regexp.sticky.js +1 -1
  44. package/modules/es.string.raw.js +2 -1
  45. package/modules/es.string.substr.js +1 -1
  46. package/modules/esnext.suppressed-error.constructor.js +3 -5
  47. package/modules/web.atob.js +5 -2
  48. package/modules/web.btoa.js +5 -2
  49. package/modules/web.dom-exception.constructor.js +4 -0
  50. package/modules/web.dom-exception.to-string-tag.js +1 -0
  51. package/package.json +1 -1
  52. package/postinstall.js +1 -1
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2022 Denis Pushkarev
1
+ Copyright (c) 2014-2023 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
@@ -15,17 +15,14 @@ var iteratorClose = require('../internals/iterator-close');
15
15
 
16
16
  var Promise = getBuiltIn('Promise');
17
17
 
18
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
18
19
  var ASYNC_ITERATOR_HELPER = 'AsyncIteratorHelper';
19
20
  var WRAP_FOR_VALID_ASYNC_ITERATOR = 'WrapForValidAsyncIterator';
20
21
  var setInternalState = InternalStateModule.set;
21
22
 
22
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
23
-
24
23
  var createAsyncIteratorProxyPrototype = function (IS_ITERATOR) {
25
24
  var IS_GENERATOR = !IS_ITERATOR;
26
- var ASYNC_ITERATOR_PROXY = IS_ITERATOR ? WRAP_FOR_VALID_ASYNC_ITERATOR : ASYNC_ITERATOR_HELPER;
27
-
28
- var getInternalState = InternalStateModule.getterFor(ASYNC_ITERATOR_PROXY);
25
+ var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ASYNC_ITERATOR : ASYNC_ITERATOR_HELPER);
29
26
 
30
27
  var getStateOrEarlyExit = function (that) {
31
28
  var stateCompletion = perform(function () {
@@ -55,7 +52,7 @@ var createAsyncIteratorProxyPrototype = function (IS_ITERATOR) {
55
52
  return state.awaiting ? state.awaiting = state.awaiting.then(task, task) : task();
56
53
  };
57
54
 
58
- var AsyncIteratorProxyPrototype = defineBuiltIns(create(AsyncIteratorPrototype), {
55
+ return defineBuiltIns(create(AsyncIteratorPrototype), {
59
56
  next: function next() {
60
57
  var stateCompletion = getStateOrEarlyExit(this);
61
58
  var exit = stateCompletion.exit;
@@ -82,7 +79,7 @@ var createAsyncIteratorProxyPrototype = function (IS_ITERATOR) {
82
79
  var returnMethod, result;
83
80
  var completion = perform(function () {
84
81
  if (state.inner) try {
85
- iteratorClose(state.inner.iterator, 'return');
82
+ iteratorClose(state.inner.iterator, 'normal');
86
83
  } catch (error) {
87
84
  return iteratorClose(iterator, 'throw', error);
88
85
  }
@@ -103,26 +100,20 @@ var createAsyncIteratorProxyPrototype = function (IS_ITERATOR) {
103
100
  });
104
101
  }
105
102
  });
106
-
107
- if (IS_GENERATOR) {
108
- createNonEnumerableProperty(AsyncIteratorProxyPrototype, TO_STRING_TAG, 'Async Iterator Helper');
109
- }
110
-
111
- return AsyncIteratorProxyPrototype;
112
103
  };
113
104
 
114
- var AsyncIteratorHelperPrototype = createAsyncIteratorProxyPrototype(false);
115
105
  var WrapForValidAsyncIteratorPrototype = createAsyncIteratorProxyPrototype(true);
106
+ var AsyncIteratorHelperPrototype = createAsyncIteratorProxyPrototype(false);
116
107
 
117
- module.exports = function (nextHandler, IS_ITERATOR) {
118
- var ASYNC_ITERATOR_PROXY = IS_ITERATOR ? WRAP_FOR_VALID_ASYNC_ITERATOR : ASYNC_ITERATOR_HELPER;
108
+ createNonEnumerableProperty(AsyncIteratorHelperPrototype, TO_STRING_TAG, 'Async Iterator Helper');
119
109
 
110
+ module.exports = function (nextHandler, IS_ITERATOR) {
120
111
  var AsyncIteratorProxy = function AsyncIterator(record, state) {
121
112
  if (state) {
122
113
  state.iterator = record.iterator;
123
114
  state.next = record.next;
124
115
  } else state = record;
125
- state.type = ASYNC_ITERATOR_PROXY;
116
+ state.type = IS_ITERATOR ? WRAP_FOR_VALID_ASYNC_ITERATOR : ASYNC_ITERATOR_HELPER;
126
117
  state.nextHandler = nextHandler;
127
118
  state.counter = 0;
128
119
  state.done = false;
@@ -19,8 +19,8 @@ var splice = uncurryThis([].splice);
19
19
  var id = 0;
20
20
 
21
21
  // fallback for uncaught frozen keys
22
- var uncaughtFrozenStore = function (store) {
23
- return store.frozen || (store.frozen = new UncaughtFrozenStore());
22
+ var uncaughtFrozenStore = function (state) {
23
+ return state.frozen || (state.frozen = new UncaughtFrozenStore());
24
24
  };
25
25
 
26
26
  var UncaughtFrozenStore = function () {
@@ -1,4 +1,3 @@
1
1
  var userAgent = require('../internals/engine-user-agent');
2
- var global = require('../internals/global');
3
2
 
4
- module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
3
+ module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';
@@ -1,4 +1,3 @@
1
1
  var classof = require('../internals/classof-raw');
2
- var global = require('../internals/global');
3
2
 
4
- module.exports = classof(global.process) == 'process';
3
+ module.exports = typeof process != 'undefined' && classof(process) == 'process';
@@ -1,3 +1 @@
1
- var getBuiltIn = require('../internals/get-built-in');
2
-
3
- module.exports = getBuiltIn('navigator', 'userAgent') || '';
1
+ module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
@@ -0,0 +1,13 @@
1
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
2
+ var clearErrorStack = require('../internals/error-stack-clear');
3
+ var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');
4
+
5
+ // non-standard V8
6
+ var captureStackTrace = Error.captureStackTrace;
7
+
8
+ module.exports = function (error, C, stack, dropEntries) {
9
+ if (ERROR_STACK_INSTALLABLE) {
10
+ if (captureStackTrace) captureStackTrace(error, C);
11
+ else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));
12
+ }
13
+ };
@@ -4,6 +4,7 @@ var call = require('../internals/function-call');
4
4
  var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
5
5
 
6
6
  var $TypeError = TypeError;
7
+ var max = Math.max;
7
8
 
8
9
  var SetRecord = function (set, size, has, keys) {
9
10
  this.set = set;
@@ -31,7 +32,7 @@ module.exports = function (obj) {
31
32
  if (numSize != numSize) throw $TypeError('Invalid size');
32
33
  return new SetRecord(
33
34
  obj,
34
- toIntegerOrInfinity(numSize),
35
+ max(toIntegerOrInfinity(numSize), 0),
35
36
  aCallable(obj.has),
36
37
  aCallable(obj.keys)
37
38
  );
@@ -1,8 +1,6 @@
1
- var global = require('../internals/global');
2
-
3
1
  module.exports = function (a, b) {
4
- var console = global.console;
5
- if (console && console.error) {
2
+ try {
3
+ // eslint-disable-next-line no-console -- safe
6
4
  arguments.length == 1 ? console.error(a) : console.error(a, b);
7
- }
5
+ } catch (error) { /* empty */ }
8
6
  };
@@ -1,8 +1,6 @@
1
1
  var classof = require('../internals/classof');
2
- var uncurryThis = require('../internals/function-uncurry-this');
3
-
4
- var slice = uncurryThis(''.slice);
5
2
 
6
3
  module.exports = function (it) {
7
- return slice(classof(it), 0, 3) === 'Big';
4
+ var klass = classof(it);
5
+ return klass == 'BigInt64Array' || klass == 'BigUint64Array';
8
6
  };
@@ -10,18 +10,15 @@ var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype
10
10
  var createIterResultObject = require('../internals/create-iter-result-object');
11
11
  var iteratorClose = require('../internals/iterator-close');
12
12
 
13
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
13
14
  var ITERATOR_HELPER = 'IteratorHelper';
14
15
  var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
15
16
  var setInternalState = InternalStateModule.set;
16
17
 
17
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
18
-
19
18
  var createIteratorProxyPrototype = function (IS_ITERATOR) {
20
- var ITERATOR_PROXY = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
19
+ var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
21
20
 
22
- var getInternalState = InternalStateModule.getterFor(ITERATOR_PROXY);
23
-
24
- var IteratorProxyPrototype = defineBuiltIns(create(IteratorPrototype), {
21
+ return defineBuiltIns(create(IteratorPrototype), {
25
22
  next: function next() {
26
23
  var state = getInternalState(this);
27
24
  // for simplification:
@@ -45,34 +42,28 @@ var createIteratorProxyPrototype = function (IS_ITERATOR) {
45
42
  return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);
46
43
  }
47
44
  if (state.inner) try {
48
- iteratorClose(state.inner.iterator, 'return');
45
+ iteratorClose(state.inner.iterator, 'normal');
49
46
  } catch (error) {
50
47
  return iteratorClose(iterator, 'throw', error);
51
48
  }
52
- iteratorClose(iterator, 'return');
49
+ iteratorClose(iterator, 'normal');
53
50
  return createIterResultObject(undefined, true);
54
51
  }
55
52
  });
56
-
57
- if (!IS_ITERATOR) {
58
- createNonEnumerableProperty(IteratorProxyPrototype, TO_STRING_TAG, 'Iterator Helper');
59
- }
60
-
61
- return IteratorProxyPrototype;
62
53
  };
63
54
 
64
- var IteratorHelperPrototype = createIteratorProxyPrototype(false);
65
55
  var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
56
+ var IteratorHelperPrototype = createIteratorProxyPrototype(false);
66
57
 
67
- module.exports = function (nextHandler, IS_ITERATOR) {
68
- var ITERATOR_PROXY = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
58
+ createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
69
59
 
60
+ module.exports = function (nextHandler, IS_ITERATOR) {
70
61
  var IteratorProxy = function Iterator(record, state) {
71
62
  if (state) {
72
63
  state.iterator = record.iterator;
73
64
  state.next = record.next;
74
65
  } else state = record;
75
- state.type = ITERATOR_PROXY;
66
+ state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
76
67
  state.nextHandler = nextHandler;
77
68
  state.counter = 0;
78
69
  state.done = false;
@@ -1,3 +1,4 @@
1
+ var uncurryThis = require('../internals/function-uncurry-this');
1
2
  var fails = require('../internals/fails');
2
3
  var isCallable = require('../internals/is-callable');
3
4
  var hasOwn = require('../internals/has-own-property');
@@ -8,8 +9,12 @@ var InternalStateModule = require('../internals/internal-state');
8
9
 
9
10
  var enforceInternalState = InternalStateModule.enforce;
10
11
  var getInternalState = InternalStateModule.get;
12
+ var $String = String;
11
13
  // eslint-disable-next-line es/no-object-defineproperty -- safe
12
14
  var defineProperty = Object.defineProperty;
15
+ var stringSlice = uncurryThis(''.slice);
16
+ var replace = uncurryThis(''.replace);
17
+ var join = uncurryThis([].join);
13
18
 
14
19
  var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
15
20
  return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
@@ -18,8 +23,8 @@ var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
18
23
  var TEMPLATE = String(String).split('String');
19
24
 
20
25
  var makeBuiltIn = module.exports = function (value, name, options) {
21
- if (String(name).slice(0, 7) === 'Symbol(') {
22
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
26
+ if (stringSlice($String(name), 0, 7) === 'Symbol(') {
27
+ name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
23
28
  }
24
29
  if (options && options.getter) name = 'get ' + name;
25
30
  if (options && options.setter) name = 'set ' + name;
@@ -38,7 +43,7 @@ var makeBuiltIn = module.exports = function (value, name, options) {
38
43
  } catch (error) { /* empty */ }
39
44
  var state = enforceInternalState(value);
40
45
  if (!hasOwn(state, 'source')) {
41
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
46
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
42
47
  } return value;
43
48
  };
44
49
 
@@ -2,6 +2,7 @@ var global = require('../internals/global');
2
2
  var bind = require('../internals/function-bind-context');
3
3
  var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
4
4
  var macrotask = require('../internals/task').set;
5
+ var Queue = require('../internals/queue');
5
6
  var IS_IOS = require('../internals/engine-is-ios');
6
7
  var IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');
7
8
  var IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');
@@ -13,26 +14,22 @@ var process = global.process;
13
14
  var Promise = global.Promise;
14
15
  // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
15
16
  var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
16
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
17
-
18
- var flush, head, last, notify, toggle, node, promise, then;
17
+ var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
18
+ var notify, toggle, node, promise, then;
19
19
 
20
20
  // modern engines have queueMicrotask method
21
- if (!queueMicrotask) {
22
- flush = function () {
21
+ if (!microtask) {
22
+ var queue = new Queue();
23
+
24
+ var flush = function () {
23
25
  var parent, fn;
24
26
  if (IS_NODE && (parent = process.domain)) parent.exit();
25
- while (head) {
26
- fn = head.fn;
27
- head = head.next;
28
- try {
29
- fn();
30
- } catch (error) {
31
- if (head) notify();
32
- else last = undefined;
33
- throw error;
34
- }
35
- } last = undefined;
27
+ while (fn = queue.get()) try {
28
+ fn();
29
+ } catch (error) {
30
+ if (queue.head) notify();
31
+ throw error;
32
+ }
36
33
  if (parent) parent.enter();
37
34
  };
38
35
 
@@ -67,19 +64,17 @@ if (!queueMicrotask) {
67
64
  // - onreadystatechange
68
65
  // - setTimeout
69
66
  } else {
70
- // strange IE + webpack dev server bug - use .bind(global)
67
+ // `webpack` dev server bug on IE global methods - use bind(fn, global)
71
68
  macrotask = bind(macrotask, global);
72
69
  notify = function () {
73
70
  macrotask(flush);
74
71
  };
75
72
  }
73
+
74
+ microtask = function (fn) {
75
+ if (!queue.head) notify();
76
+ queue.add(fn);
77
+ };
76
78
  }
77
79
 
78
- module.exports = queueMicrotask || function (fn) {
79
- var task = { fn: fn, next: undefined };
80
- if (last) last.next = task;
81
- if (!head) {
82
- head = task;
83
- notify();
84
- } last = task;
85
- };
80
+ module.exports = microtask;
@@ -6,15 +6,16 @@ var Queue = function () {
6
6
  Queue.prototype = {
7
7
  add: function (item) {
8
8
  var entry = { item: item, next: null };
9
- if (this.head) this.tail.next = entry;
9
+ var tail = this.tail;
10
+ if (tail) tail.next = entry;
10
11
  else this.head = entry;
11
12
  this.tail = entry;
12
13
  },
13
14
  get: function () {
14
15
  var entry = this.head;
15
16
  if (entry) {
16
- this.head = entry.next;
17
- if (this.tail === entry) this.tail = null;
17
+ var next = this.head = entry.next;
18
+ if (next === null) this.tail = null;
18
19
  return entry.item;
19
20
  }
20
21
  }
@@ -5,18 +5,18 @@ var size = require('../internals/set-size');
5
5
  var getSetRecord = require('../internals/get-set-record');
6
6
  var iterateSet = require('../internals/set-iterate');
7
7
  var iterateSimple = require('../internals/iterate-simple');
8
+ var iteratorClose = require('../internals/iterator-close');
8
9
 
9
10
  // `Set.prototype.isDisjointFrom` method
10
11
  // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
11
12
  module.exports = function isDisjointFrom(other) {
12
13
  var O = aSet(this);
13
14
  var otherRec = getSetRecord(other);
14
- return false !== (size(O) <= otherRec.size
15
- ? iterateSet(O, function (e) {
16
- if (otherRec.includes(e)) return false;
17
- }, true)
18
- : iterateSimple(otherRec.getIterator(), function (e) {
19
- if (has(O, e)) return false;
20
- })
21
- );
15
+ if (size(O) <= otherRec.size) return iterateSet(O, function (e) {
16
+ if (otherRec.includes(e)) return false;
17
+ }, true) !== false;
18
+ var iterator = otherRec.getIterator();
19
+ return iterateSimple(iterator, function (e) {
20
+ if (has(O, e)) return iteratorClose(iterator, 'normal', false);
21
+ }) !== false;
22
22
  };
@@ -4,6 +4,7 @@ var has = require('../internals/set-helpers').has;
4
4
  var size = require('../internals/set-size');
5
5
  var getSetRecord = require('../internals/get-set-record');
6
6
  var iterateSimple = require('../internals/iterate-simple');
7
+ var iteratorClose = require('../internals/iterator-close');
7
8
 
8
9
  // `Set.prototype.isSupersetOf` method
9
10
  // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf
@@ -11,7 +12,8 @@ module.exports = function isSupersetOf(other) {
11
12
  var O = aSet(this);
12
13
  var otherRec = getSetRecord(other);
13
14
  if (size(O) < otherRec.size) return false;
14
- return iterateSimple(otherRec.getIterator(), function (e) {
15
- if (has(O, e) === false) return false;
15
+ var iterator = otherRec.getIterator();
16
+ return iterateSimple(iterator, function (e) {
17
+ if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
16
18
  }) !== false;
17
19
  };
@@ -4,9 +4,9 @@ var store = require('../internals/shared-store');
4
4
  (module.exports = function (key, value) {
5
5
  return store[key] || (store[key] = value !== undefined ? value : {});
6
6
  })('versions', []).push({
7
- version: '3.27.1',
7
+ version: '3.27.2',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
10
- license: 'https://github.com/zloirock/core-js/blob/v3.27.1/LICENSE',
9
+ copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
10
+ license: 'https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE',
11
11
  source: 'https://github.com/zloirock/core-js'
12
12
  });
@@ -7,9 +7,12 @@ var $TypeError = TypeError;
7
7
  var push = uncurryThis([].push);
8
8
  var join = uncurryThis([].join);
9
9
 
10
+ // `String.cooked` method
11
+ // https://tc39.es/proposal-string-cooked/
10
12
  module.exports = function cooked(template /* , ...substitutions */) {
11
13
  var cookedTemplate = toIndexedObject(template);
12
14
  var literalSegments = lengthOfArrayLike(cookedTemplate);
15
+ if (!literalSegments) return '';
13
16
  var argumentsLength = arguments.length;
14
17
  var elements = [];
15
18
  var i = 0;
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
3
2
  var uncurryThis = require('../internals/function-uncurry-this');
4
3
 
package/internals/task.js CHANGED
@@ -23,10 +23,10 @@ var queue = {};
23
23
  var ONREADYSTATECHANGE = 'onreadystatechange';
24
24
  var $location, defer, channel, port;
25
25
 
26
- try {
26
+ fails(function () {
27
27
  // Deno throws a ReferenceError on `location` access without `--location` flag
28
28
  $location = global.location;
29
- } catch (error) { /* empty */ }
29
+ });
30
30
 
31
31
  var run = function (id) {
32
32
  if (hasOwn(queue, id)) {
@@ -42,11 +42,11 @@ var runner = function (id) {
42
42
  };
43
43
  };
44
44
 
45
- var listener = function (event) {
45
+ var eventListener = function (event) {
46
46
  run(event.data);
47
47
  };
48
48
 
49
- var post = function (id) {
49
+ var globalPostMessageDefer = function (id) {
50
50
  // old engines have not location.origin
51
51
  global.postMessage(String(id), $location.protocol + '//' + $location.host);
52
52
  };
@@ -81,7 +81,7 @@ if (!set || !clear) {
81
81
  } else if (MessageChannel && !IS_IOS) {
82
82
  channel = new MessageChannel();
83
83
  port = channel.port2;
84
- channel.port1.onmessage = listener;
84
+ channel.port1.onmessage = eventListener;
85
85
  defer = bind(port.postMessage, port);
86
86
  // Browsers with postMessage, skip WebWorkers
87
87
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
@@ -90,10 +90,10 @@ if (!set || !clear) {
90
90
  isCallable(global.postMessage) &&
91
91
  !global.importScripts &&
92
92
  $location && $location.protocol !== 'file:' &&
93
- !fails(post)
93
+ !fails(globalPostMessageDefer)
94
94
  ) {
95
- defer = post;
96
- global.addEventListener('message', listener, false);
95
+ defer = globalPostMessageDefer;
96
+ global.addEventListener('message', eventListener, false);
97
97
  // IE8-
98
98
  } else if (ONREADYSTATECHANGE in createElement('script')) {
99
99
  defer = function (id) {
@@ -5,20 +5,14 @@ var uid = require('../internals/uid');
5
5
  var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
6
6
  var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
7
7
 
8
- var WellKnownSymbolsStore = shared('wks');
9
8
  var Symbol = global.Symbol;
10
- var symbolFor = Symbol && Symbol['for'];
11
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
9
+ var WellKnownSymbolsStore = shared('wks');
10
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
12
11
 
13
12
  module.exports = function (name) {
14
- if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
15
- var description = 'Symbol.' + name;
16
- if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
17
- WellKnownSymbolsStore[name] = Symbol[name];
18
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
19
- WellKnownSymbolsStore[name] = symbolFor(description);
20
- } else {
21
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
22
- }
13
+ if (!hasOwn(WellKnownSymbolsStore, name)) {
14
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
15
+ ? Symbol[name]
16
+ : createWellKnownSymbol('Symbol.' + name);
23
17
  } return WellKnownSymbolsStore[name];
24
18
  };
@@ -9,8 +9,7 @@ var proxyAccessor = require('../internals/proxy-accessor');
9
9
  var inheritIfRequired = require('../internals/inherit-if-required');
10
10
  var normalizeStringArgument = require('../internals/normalize-string-argument');
11
11
  var installErrorCause = require('../internals/install-error-cause');
12
- var clearErrorStack = require('../internals/error-stack-clear');
13
- var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');
12
+ var installErrorStack = require('../internals/error-stack-install');
14
13
  var DESCRIPTORS = require('../internals/descriptors');
15
14
  var IS_PURE = require('../internals/is-pure');
16
15
 
@@ -36,7 +35,7 @@ module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
36
35
  var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
37
36
  var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
38
37
  if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
39
- if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(result, 'stack', clearErrorStack(result.stack, 2));
38
+ installErrorStack(result, WrappedError, result.stack, 2);
40
39
  if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
41
40
  if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
42
41
  return result;
@@ -7,19 +7,17 @@ var copyConstructorProperties = require('../internals/copy-constructor-propertie
7
7
  var create = require('../internals/object-create');
8
8
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
9
9
  var createPropertyDescriptor = require('../internals/create-property-descriptor');
10
- var clearErrorStack = require('../internals/error-stack-clear');
11
10
  var installErrorCause = require('../internals/install-error-cause');
11
+ var installErrorStack = require('../internals/error-stack-install');
12
12
  var iterate = require('../internals/iterate');
13
13
  var normalizeStringArgument = require('../internals/normalize-string-argument');
14
14
  var wellKnownSymbol = require('../internals/well-known-symbol');
15
- var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');
16
15
 
17
16
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
18
17
  var $Error = Error;
19
18
  var push = [].push;
20
19
 
21
20
  var $AggregateError = function AggregateError(errors, message /* , options */) {
22
- var options = arguments.length > 2 ? arguments[2] : undefined;
23
21
  var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
24
22
  var that;
25
23
  if (setPrototypeOf) {
@@ -29,8 +27,8 @@ var $AggregateError = function AggregateError(errors, message /* , options */) {
29
27
  createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
30
28
  }
31
29
  if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
32
- if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
33
- installErrorCause(that, options);
30
+ installErrorStack(that, $AggregateError, that.stack, 1);
31
+ if (arguments.length > 2) installErrorCause(that, arguments[2]);
34
32
  var errorsArray = [];
35
33
  iterate(errors, push, { that: errorsArray });
36
34
  createNonEnumerableProperty(that, 'errors', errorsArray);
@@ -23,15 +23,13 @@ var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
23
23
  return array.concat()[0] !== array;
24
24
  });
25
25
 
26
- var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
27
-
28
26
  var isConcatSpreadable = function (O) {
29
27
  if (!isObject(O)) return false;
30
28
  var spreadable = O[IS_CONCAT_SPREADABLE];
31
29
  return spreadable !== undefined ? !!spreadable : isArray(O);
32
30
  };
33
31
 
34
- var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
32
+ var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat');
35
33
 
36
34
  // `Array.prototype.concat` method
37
35
  // https://tc39.es/ecma262/#sec-array.prototype.concat
@@ -8,11 +8,11 @@ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
8
8
  var nativeIndexOf = uncurryThis([].indexOf);
9
9
 
10
10
  var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
11
- var STRICT_METHOD = arrayMethodIsStrict('indexOf');
11
+ var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf');
12
12
 
13
13
  // `Array.prototype.indexOf` method
14
14
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
15
- $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
15
+ $({ target: 'Array', proto: true, forced: FORCED }, {
16
16
  indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
17
17
  var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
18
18
  return NEGATIVE_ZERO
@@ -8,11 +8,11 @@ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
8
8
  var nativeJoin = uncurryThis([].join);
9
9
 
10
10
  var ES3_STRINGS = IndexedObject != Object;
11
- var STRICT_METHOD = arrayMethodIsStrict('join', ',');
11
+ var FORCED = ES3_STRINGS || !arrayMethodIsStrict('join', ',');
12
12
 
13
13
  // `Array.prototype.join` method
14
14
  // https://tc39.es/ecma262/#sec-array.prototype.join
15
- $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
15
+ $({ target: 'Array', proto: true, forced: FORCED }, {
16
16
  join: function join(separator) {
17
17
  return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator);
18
18
  }
@@ -12,18 +12,20 @@ var INCORRECT_TO_LENGTH = fails(function () {
12
12
 
13
13
  // V8 and Safari <= 15.4, FF < 23 throws InternalError
14
14
  // https://bugs.chromium.org/p/v8/issues/detail?id=12681
15
- var SILENT_ON_NON_WRITABLE_LENGTH = !function () {
15
+ var properErrorOnNonWritableLength = function () {
16
16
  try {
17
17
  // eslint-disable-next-line es/no-object-defineproperty -- safe
18
18
  Object.defineProperty([], 'length', { writable: false }).push();
19
19
  } catch (error) {
20
20
  return error instanceof TypeError;
21
21
  }
22
- }();
22
+ };
23
+
24
+ var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
23
25
 
24
26
  // `Array.prototype.push` method
25
27
  // https://tc39.es/ecma262/#sec-array.prototype.push
26
- $({ target: 'Array', proto: true, arity: 1, forced: INCORRECT_TO_LENGTH || SILENT_ON_NON_WRITABLE_LENGTH }, {
28
+ $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
27
29
  // eslint-disable-next-line no-unused-vars -- required for `.length`
28
30
  push: function push(item) {
29
31
  var O = toObject(this);
@@ -5,14 +5,14 @@ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5
5
  var CHROME_VERSION = require('../internals/engine-v8-version');
6
6
  var IS_NODE = require('../internals/engine-is-node');
7
7
 
8
- var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
9
8
  // Chrome 80-82 has a critical bug
10
9
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
11
10
  var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
11
+ var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduceRight');
12
12
 
13
13
  // `Array.prototype.reduceRight` method
14
14
  // https://tc39.es/ecma262/#sec-array.prototype.reduceright
15
- $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
15
+ $({ target: 'Array', proto: true, forced: FORCED }, {
16
16
  reduceRight: function reduceRight(callbackfn /* , initialValue */) {
17
17
  return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
18
18
  }
@@ -5,14 +5,14 @@ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5
5
  var CHROME_VERSION = require('../internals/engine-v8-version');
6
6
  var IS_NODE = require('../internals/engine-is-node');
7
7
 
8
- var STRICT_METHOD = arrayMethodIsStrict('reduce');
9
8
  // Chrome 80-82 has a critical bug
10
9
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
11
10
  var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
11
+ var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduce');
12
12
 
13
13
  // `Array.prototype.reduce` method
14
14
  // https://tc39.es/ecma262/#sec-array.prototype.reduce
15
- $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
15
+ $({ target: 'Array', proto: true, forced: FORCED }, {
16
16
  reduce: function reduce(callbackfn /* , initialValue */) {
17
17
  var length = arguments.length;
18
18
  return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
@@ -10,18 +10,20 @@ var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-intege
10
10
  var INCORRECT_RESULT = [].unshift(0) !== 1;
11
11
 
12
12
  // V8 ~ Chrome < 71 and Safari <= 15.4, FF < 23 throws InternalError
13
- var SILENT_ON_NON_WRITABLE_LENGTH = !function () {
13
+ var properErrorOnNonWritableLength = function () {
14
14
  try {
15
15
  // eslint-disable-next-line es/no-object-defineproperty -- safe
16
16
  Object.defineProperty([], 'length', { writable: false }).unshift();
17
17
  } catch (error) {
18
18
  return error instanceof TypeError;
19
19
  }
20
- }();
20
+ };
21
+
22
+ var FORCED = INCORRECT_RESULT || !properErrorOnNonWritableLength();
21
23
 
22
24
  // `Array.prototype.unshift` method
23
25
  // https://tc39.es/ecma262/#sec-array.prototype.unshift
24
- $({ target: 'Array', proto: true, arity: 1, forced: INCORRECT_RESULT || SILENT_ON_NON_WRITABLE_LENGTH }, {
26
+ $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
25
27
  // eslint-disable-next-line no-unused-vars -- required for `.length`
26
28
  unshift: function unshift(item) {
27
29
  var O = toObject(this);
@@ -3,6 +3,7 @@ var $ = require('../internals/export');
3
3
  var uncurryThis = require('../internals/function-uncurry-this');
4
4
  var fails = require('../internals/fails');
5
5
 
6
+ // IE8- non-standard case
6
7
  var FORCED = fails(function () {
7
8
  return new Date(16e11).getYear() !== 120;
8
9
  });
@@ -23,6 +23,7 @@ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
23
23
  }
24
24
  };
25
25
 
26
+ // https://tc39.es/ecma262/#sec-nativeerror
26
27
  // https://github.com/tc39/proposal-error-cause
27
28
  exportGlobalErrorCauseWrapper('Error', function (init) {
28
29
  return function Error(message) { return apply(init, this, arguments); };
@@ -10,9 +10,11 @@ function asinh(x) {
10
10
  return !isFinite(n) || n == 0 ? n : n < 0 ? -asinh(-n) : log(n + sqrt(n * n + 1));
11
11
  }
12
12
 
13
+ var FORCED = !($asinh && 1 / $asinh(0) > 0);
14
+
13
15
  // `Math.asinh` method
14
16
  // https://tc39.es/ecma262/#sec-math.asinh
15
17
  // Tor Browser bug: Math.asinh(0) -> -0
16
- $({ target: 'Math', stat: true, forced: !($asinh && 1 / $asinh(0) > 0) }, {
18
+ $({ target: 'Math', stat: true, forced: FORCED }, {
17
19
  asinh: asinh
18
20
  });
@@ -4,10 +4,12 @@ var $ = require('../internals/export');
4
4
  var $atanh = Math.atanh;
5
5
  var log = Math.log;
6
6
 
7
+ var FORCED = !($atanh && 1 / $atanh(-0) < 0);
8
+
7
9
  // `Math.atanh` method
8
10
  // https://tc39.es/ecma262/#sec-math.atanh
9
11
  // Tor Browser bug: Math.atanh(-0) -> 0
10
- $({ target: 'Math', stat: true, forced: !($atanh && 1 / $atanh(-0) < 0) }, {
12
+ $({ target: 'Math', stat: true, forced: FORCED }, {
11
13
  atanh: function atanh(x) {
12
14
  var n = +x;
13
15
  return n == 0 ? n : log((1 + n) / (1 - n)) / 2;
@@ -6,9 +6,11 @@ var $cosh = Math.cosh;
6
6
  var abs = Math.abs;
7
7
  var E = Math.E;
8
8
 
9
+ var FORCED = !$cosh || $cosh(710) === Infinity;
10
+
9
11
  // `Math.cosh` method
10
12
  // https://tc39.es/ecma262/#sec-math.cosh
11
- $({ target: 'Math', stat: true, forced: !$cosh || $cosh(710) === Infinity }, {
13
+ $({ target: 'Math', stat: true, forced: FORCED }, {
12
14
  cosh: function cosh(x) {
13
15
  var t = expm1(abs(x) - 1) + 1;
14
16
  return (t + 1 / (t * E * E)) * (E / 2);
@@ -7,11 +7,11 @@ var sqrt = Math.sqrt;
7
7
 
8
8
  // Chrome 77 bug
9
9
  // https://bugs.chromium.org/p/v8/issues/detail?id=9546
10
- var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
10
+ var FORCED = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
11
11
 
12
12
  // `Math.hypot` method
13
13
  // https://tc39.es/ecma262/#sec-math.hypot
14
- $({ target: 'Math', stat: true, arity: 2, forced: BUGGY }, {
14
+ $({ target: 'Math', stat: true, arity: 2, forced: FORCED }, {
15
15
  // eslint-disable-next-line no-unused-vars -- required for `.length`
16
16
  hypot: function hypot(value1, value2) {
17
17
  var sum = 0;
@@ -28,20 +28,23 @@ var ROUNDS_PROPERLY = nativeToExponential(-6.9e-11, 4) === '-6.9000e-11'
28
28
  && nativeToExponential(25, 0) === '3e+1';
29
29
 
30
30
  // IE8-
31
- var THROWS_ON_INFINITY_FRACTION = fails(function () {
32
- nativeToExponential(1, Infinity);
33
- }) && fails(function () {
34
- nativeToExponential(1, -Infinity);
35
- });
31
+ var throwsOnInfinityFraction = function () {
32
+ return fails(function () {
33
+ nativeToExponential(1, Infinity);
34
+ }) && fails(function () {
35
+ nativeToExponential(1, -Infinity);
36
+ });
37
+ };
36
38
 
37
39
  // Safari <11 && FF <50
38
- var PROPER_NON_FINITE_THIS_CHECK = !fails(function () {
39
- nativeToExponential(Infinity, Infinity);
40
- }) && !fails(function () {
41
- nativeToExponential(NaN, Infinity);
42
- });
40
+ var properNonFiniteThisCheck = function () {
41
+ return !fails(function () {
42
+ nativeToExponential(Infinity, Infinity);
43
+ nativeToExponential(NaN, Infinity);
44
+ });
45
+ };
43
46
 
44
- var FORCED = !ROUNDS_PROPERLY || !THROWS_ON_INFINITY_FRACTION || !PROPER_NON_FINITE_THIS_CHECK;
47
+ var FORCED = !ROUNDS_PROPERLY || !throwsOnInfinityFraction() || !properNonFiniteThisCheck();
45
48
 
46
49
  // `Number.prototype.toExponential` method
47
50
  // https://tc39.es/ecma262/#sec-number.prototype.toexponential
@@ -4,8 +4,7 @@ var toIndexedObject = require('../internals/to-indexed-object');
4
4
  var nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
5
5
  var DESCRIPTORS = require('../internals/descriptors');
6
6
 
7
- var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
8
- var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
7
+ var FORCED = !DESCRIPTORS || fails(function () { nativeGetOwnPropertyDescriptor(1); });
9
8
 
10
9
  // `Object.getOwnPropertyDescriptor` method
11
10
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
@@ -6,11 +6,12 @@ var ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensi
6
6
 
7
7
  // eslint-disable-next-line es/no-object-isfrozen -- safe
8
8
  var $isFrozen = Object.isFrozen;
9
- var FAILS_ON_PRIMITIVES = fails(function () { $isFrozen(1); });
9
+
10
+ var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () { $isFrozen(1); });
10
11
 
11
12
  // `Object.isFrozen` method
12
13
  // https://tc39.es/ecma262/#sec-object.isfrozen
13
- $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE }, {
14
+ $({ target: 'Object', stat: true, forced: FORCED }, {
14
15
  isFrozen: function isFrozen(it) {
15
16
  if (!isObject(it)) return true;
16
17
  if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return true;
@@ -6,11 +6,12 @@ var ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensi
6
6
 
7
7
  // eslint-disable-next-line es/no-object-issealed -- safe
8
8
  var $isSealed = Object.isSealed;
9
- var FAILS_ON_PRIMITIVES = fails(function () { $isSealed(1); });
9
+
10
+ var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () { $isSealed(1); });
10
11
 
11
12
  // `Object.isSealed` method
12
13
  // https://tc39.es/ecma262/#sec-object.issealed
13
- $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE }, {
14
+ $({ target: 'Object', stat: true, forced: FORCED }, {
14
15
  isSealed: function isSealed(it) {
15
16
  if (!isObject(it)) return true;
16
17
  if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return true;
@@ -5,10 +5,11 @@ var aCallable = require('../internals/a-callable');
5
5
  var newPromiseCapabilityModule = require('../internals/new-promise-capability');
6
6
  var perform = require('../internals/perform');
7
7
  var iterate = require('../internals/iterate');
8
+ var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');
8
9
 
9
10
  // `Promise.allSettled` method
10
11
  // https://tc39.es/ecma262/#sec-promise.allsettled
11
- $({ target: 'Promise', stat: true }, {
12
+ $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
12
13
  allSettled: function allSettled(iterable) {
13
14
  var C = this;
14
15
  var capability = newPromiseCapabilityModule.f(C);
@@ -6,12 +6,13 @@ var getBuiltIn = require('../internals/get-built-in');
6
6
  var newPromiseCapabilityModule = require('../internals/new-promise-capability');
7
7
  var perform = require('../internals/perform');
8
8
  var iterate = require('../internals/iterate');
9
+ var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');
9
10
 
10
11
  var PROMISE_ANY_ERROR = 'No one promise resolved';
11
12
 
12
13
  // `Promise.any` method
13
14
  // https://tc39.es/ecma262/#sec-promise.any
14
- $({ target: 'Promise', stat: true }, {
15
+ $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
15
16
  any: function any(iterable) {
16
17
  var C = this;
17
18
  var AggregateError = getBuiltIn('AggregateError');
@@ -13,7 +13,7 @@ if (DESCRIPTORS && MISSED_STICKY) {
13
13
  defineBuiltInAccessor(RegExpPrototype, 'sticky', {
14
14
  configurable: true,
15
15
  get: function sticky() {
16
- if (this === RegExpPrototype) return undefined;
16
+ if (this === RegExpPrototype) return;
17
17
  // We can't use InternalStateModule.getterFor because
18
18
  // we don't add metadata for regexps created by a literal.
19
19
  if (classof(this) === 'RegExp') {
@@ -14,10 +14,11 @@ $({ target: 'String', stat: true }, {
14
14
  raw: function raw(template) {
15
15
  var rawTemplate = toIndexedObject(toObject(template).raw);
16
16
  var literalSegments = lengthOfArrayLike(rawTemplate);
17
+ if (!literalSegments) return '';
17
18
  var argumentsLength = arguments.length;
18
19
  var elements = [];
19
20
  var i = 0;
20
- while (literalSegments > i) {
21
+ while (true) {
21
22
  push(elements, toString(rawTemplate[i++]));
22
23
  if (i === literalSegments) return join(elements, '');
23
24
  if (i < argumentsLength) push(elements, toString(arguments[i]));
@@ -9,7 +9,7 @@ var stringSlice = uncurryThis(''.slice);
9
9
  var max = Math.max;
10
10
  var min = Math.min;
11
11
 
12
- // eslint-disable-next-line unicorn/prefer-string-slice, es/no-string-prototype-substr -- required for testing
12
+ // eslint-disable-next-line unicorn/prefer-string-slice -- required for testing
13
13
  var FORCED = !''.substr || 'ab'.substr(-1) !== 'b';
14
14
 
15
15
  // `String.prototype.substr` method
@@ -7,17 +7,15 @@ var copyConstructorProperties = require('../internals/copy-constructor-propertie
7
7
  var create = require('../internals/object-create');
8
8
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
9
9
  var createPropertyDescriptor = require('../internals/create-property-descriptor');
10
- var clearErrorStack = require('../internals/error-stack-clear');
11
10
  var installErrorCause = require('../internals/install-error-cause');
11
+ var installErrorStack = require('../internals/error-stack-install');
12
12
  var normalizeStringArgument = require('../internals/normalize-string-argument');
13
13
  var wellKnownSymbol = require('../internals/well-known-symbol');
14
- var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');
15
14
 
16
15
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
17
16
  var $Error = Error;
18
17
 
19
18
  var $SuppressedError = function SuppressedError(error, suppressed, message /* , options */) {
20
- var options = arguments.length > 3 ? arguments[3] : undefined;
21
19
  var isInstance = isPrototypeOf(SuppressedErrorPrototype, this);
22
20
  var that;
23
21
  if (setPrototypeOf) {
@@ -27,8 +25,8 @@ var $SuppressedError = function SuppressedError(error, suppressed, message /* ,
27
25
  createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
28
26
  }
29
27
  if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
30
- if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
31
- installErrorCause(that, options);
28
+ installErrorStack(that, $SuppressedError, that.stack, 1);
29
+ if (arguments.length > 3) installErrorCause(that, arguments[3]);
32
30
  createNonEnumerableProperty(that, 'error', error);
33
31
  createNonEnumerableProperty(that, 'suppressed', suppressed);
34
32
  return that;
@@ -1,6 +1,8 @@
1
1
  var $ = require('../internals/export');
2
+ var global = require('../internals/global');
2
3
  var getBuiltIn = require('../internals/get-built-in');
3
4
  var uncurryThis = require('../internals/function-uncurry-this');
5
+ var call = require('../internals/function-call');
4
6
  var fails = require('../internals/fails');
5
7
  var toString = require('../internals/to-string');
6
8
  var hasOwn = require('../internals/has-own-property');
@@ -33,10 +35,11 @@ var WRONG_ARITY = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && $atob.length !== 1;
33
35
 
34
36
  // `atob` method
35
37
  // https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob
36
- $({ global: true, enumerable: true, forced: NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY }, {
38
+ $({ global: true, bind: true, enumerable: true, forced: NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY }, {
37
39
  atob: function atob(data) {
38
40
  validateArgumentsLength(arguments.length, 1);
39
- if (NO_ARG_RECEIVING_CHECK || WRONG_ARITY) return $atob(data);
41
+ // `webpack` dev server bug on IE global methods - use call(fn, global, ...)
42
+ if (NO_ARG_RECEIVING_CHECK || WRONG_ARITY) return call($atob, global, data);
40
43
  var string = replace(toString(data), whitespaces, '');
41
44
  var output = '';
42
45
  var position = 0;
@@ -1,6 +1,8 @@
1
1
  var $ = require('../internals/export');
2
+ var global = require('../internals/global');
2
3
  var getBuiltIn = require('../internals/get-built-in');
3
4
  var uncurryThis = require('../internals/function-uncurry-this');
5
+ var call = require('../internals/function-call');
4
6
  var fails = require('../internals/fails');
5
7
  var toString = require('../internals/to-string');
6
8
  var validateArgumentsLength = require('../internals/validate-arguments-length');
@@ -22,10 +24,11 @@ var WRONG_ARITY = !!$btoa && $btoa.length !== 1;
22
24
 
23
25
  // `btoa` method
24
26
  // https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa
25
- $({ global: true, enumerable: true, forced: NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, {
27
+ $({ global: true, bind: true, enumerable: true, forced: NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, {
26
28
  btoa: function btoa(data) {
27
29
  validateArgumentsLength(arguments.length, 1);
28
- if (NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY) return $btoa(toString(data));
30
+ // `webpack` dev server bug on IE global methods - use call(fn, global, ...)
31
+ if (NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY) return call($btoa, global, toString(data));
29
32
  var string = toString(data);
30
33
  var output = '';
31
34
  var position = 0;
@@ -80,8 +80,11 @@ var getterFor = function (key) {
80
80
  };
81
81
 
82
82
  if (DESCRIPTORS) {
83
+ // `DOMException.prototype.code` getter
83
84
  defineBuiltInAccessor(DOMExceptionPrototype, 'code', getterFor('code'));
85
+ // `DOMException.prototype.message` getter
84
86
  defineBuiltInAccessor(DOMExceptionPrototype, 'message', getterFor('message'));
87
+ // `DOMException.prototype.name` getter
85
88
  defineBuiltInAccessor(DOMExceptionPrototype, 'name', getterFor('name'));
86
89
  }
87
90
 
@@ -128,6 +131,7 @@ if (INCORRECT_CODE && DESCRIPTORS && NativeDOMException === PolyfilledDOMExcepti
128
131
  }));
129
132
  }
130
133
 
134
+ // `DOMException` constants
131
135
  for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) {
132
136
  var constant = DOMExceptionConstants[key];
133
137
  var constantName = constant.s;
@@ -3,4 +3,5 @@ var setToStringTag = require('../internals/set-to-string-tag');
3
3
 
4
4
  var DOM_EXCEPTION = 'DOMException';
5
5
 
6
+ // `DOMException.prototype[@@toStringTag]` property
6
7
  setToStringTag(getBuiltIn(DOM_EXCEPTION), DOM_EXCEPTION);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js",
3
- "version": "3.27.1",
3
+ "version": "3.27.2",
4
4
  "description": "Standard library",
5
5
  "keywords": [
6
6
  "ES3",
package/postinstall.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var fs = require('fs');
2
2
  var os = require('os');
3
3
  var path = require('path');
4
- var env = process.env;
5
4
 
5
+ var env = process.env;
6
6
  var ADBLOCK = is(env.ADBLOCK);
7
7
  var COLOR = is(env.npm_config_color);
8
8
  var DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE);