core-js 3.8.3 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/es/json/stringify.js +1 -1
  2. package/features/array/find-last-index.js +4 -0
  3. package/features/array/find-last.js +4 -0
  4. package/features/array/index.js +2 -0
  5. package/features/array/virtual/find-last-index.js +4 -0
  6. package/features/array/virtual/find-last.js +4 -0
  7. package/features/array/virtual/index.js +3 -0
  8. package/features/instance/find-last-index.js +8 -0
  9. package/features/instance/find-last.js +8 -0
  10. package/features/typed-array/find-last-index.js +1 -0
  11. package/features/typed-array/find-last.js +1 -0
  12. package/features/typed-array/index.js +4 -0
  13. package/features/typed-array/unique-by.js +2 -0
  14. package/internals/array-buffer-view-core.js +1 -1
  15. package/internals/array-buffer.js +6 -4
  16. package/internals/array-for-each.js +1 -3
  17. package/internals/array-includes.js +2 -2
  18. package/internals/array-iteration-from-last.js +34 -0
  19. package/internals/array-last-index-of.js +1 -4
  20. package/internals/array-method-is-strict.js +1 -1
  21. package/internals/array-unique-by.js +32 -0
  22. package/internals/async-iterator-prototype.js +1 -1
  23. package/internals/check-correctness-of-iteration.js +1 -1
  24. package/internals/collection.js +9 -5
  25. package/internals/fix-regexp-well-known-symbol-logic.js +1 -0
  26. package/internals/function-bind.js +1 -1
  27. package/internals/get-map-iterator.js +1 -1
  28. package/internals/get-set-iterator.js +1 -1
  29. package/internals/global.js +2 -2
  30. package/internals/ieee754.js +2 -4
  31. package/internals/indexed-object.js +1 -1
  32. package/internals/is-iterable.js +1 -1
  33. package/internals/math-fround.js +1 -1
  34. package/internals/math-scale.js +2 -2
  35. package/internals/math-sign.js +1 -1
  36. package/internals/native-symbol.js +1 -1
  37. package/internals/object-assign.js +2 -2
  38. package/internals/object-create.js +1 -1
  39. package/internals/object-prototype-accessors-forced.js +1 -1
  40. package/internals/object-set-prototype-of.js +1 -1
  41. package/internals/range-iterator.js +1 -1
  42. package/internals/regexp-exec.js +1 -0
  43. package/internals/same-value-zero.js +1 -1
  44. package/internals/same-value.js +1 -1
  45. package/internals/shared.js +1 -1
  46. package/internals/string-pad-webkit-bug.js +1 -1
  47. package/internals/string-punycode-to-ascii.js +1 -1
  48. package/internals/task.js +2 -2
  49. package/internals/typed-array-constructors-require-wrappers.js +1 -1
  50. package/internals/typed-array-from-species-and-list.js +11 -0
  51. package/internals/use-symbol-as-uid.js +1 -2
  52. package/internals/whitespaces.js +2 -2
  53. package/modules/es.aggregate-error.js +1 -1
  54. package/modules/es.array.concat.js +2 -1
  55. package/modules/es.array.every.js +1 -3
  56. package/modules/es.array.filter.js +1 -4
  57. package/modules/es.array.find-index.js +1 -4
  58. package/modules/es.array.find.js +1 -4
  59. package/modules/es.array.includes.js +1 -4
  60. package/modules/es.array.index-of.js +1 -3
  61. package/modules/es.array.map.js +1 -4
  62. package/modules/es.array.reduce-right.js +1 -4
  63. package/modules/es.array.reduce.js +1 -3
  64. package/modules/es.array.reverse.js +1 -1
  65. package/modules/es.array.slice.js +1 -3
  66. package/modules/es.array.some.js +1 -3
  67. package/modules/es.array.splice.js +1 -3
  68. package/modules/es.date.to-json.js +1 -1
  69. package/modules/es.date.to-string.js +1 -1
  70. package/modules/es.json.stringify.js +1 -1
  71. package/modules/es.math.hypot.js +2 -1
  72. package/modules/es.number.is-nan.js +1 -1
  73. package/modules/es.number.to-fixed.js +43 -44
  74. package/modules/es.promise.js +2 -2
  75. package/modules/es.reflect.define-property.js +1 -1
  76. package/modules/es.reflect.set.js +1 -1
  77. package/modules/es.string.from-code-point.js +2 -1
  78. package/modules/es.string.match-all.js +1 -1
  79. package/modules/es.string.split.js +2 -0
  80. package/modules/es.symbol.js +1 -1
  81. package/modules/es.typed-array.fill.js +1 -1
  82. package/modules/es.typed-array.filter.js +2 -8
  83. package/modules/es.typed-array.join.js +1 -1
  84. package/modules/es.typed-array.last-index-of.js +1 -1
  85. package/modules/es.typed-array.set.js +1 -1
  86. package/modules/es.typed-array.slice.js +1 -1
  87. package/modules/esnext.array.find-last-index.js +14 -0
  88. package/modules/esnext.array.find-last.js +14 -0
  89. package/modules/esnext.array.unique-by.js +2 -28
  90. package/modules/esnext.bigint.range.js +1 -1
  91. package/modules/esnext.map.merge.js +1 -1
  92. package/modules/esnext.typed-array.filter-out.js +2 -8
  93. package/modules/esnext.typed-array.find-last-index.js +12 -0
  94. package/modules/esnext.typed-array.find-last.js +12 -0
  95. package/modules/esnext.typed-array.unique-by.js +13 -0
  96. package/modules/web.timers.js +1 -1
  97. package/modules/web.url.js +9 -11
  98. package/package.json +2 -2
  99. package/postinstall.js +2 -2
  100. package/proposals/array-find-from-last.js +5 -0
  101. package/proposals/array-unique.js +1 -0
  102. package/stable/instance/entries.js +1 -1
  103. package/stable/instance/for-each.js +1 -1
  104. package/stable/instance/keys.js +1 -1
  105. package/stable/instance/values.js +1 -1
  106. package/stage/1.js +1 -0
  107. package/internals/array-method-uses-to-length.js +0 -27
@@ -3,7 +3,7 @@ var core = require('../../internals/path');
3
3
 
4
4
  if (!core.JSON) core.JSON = { stringify: JSON.stringify };
5
5
 
6
- // eslint-disable-next-line no-unused-vars
6
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
7
7
  module.exports = function stringify(it, replacer, space) {
8
8
  return core.JSON.stringify.apply(null, arguments);
9
9
  };
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.array.find-last-index');
2
+ var entryUnbind = require('../../internals/entry-unbind');
3
+
4
+ module.exports = entryUnbind('Array', 'findLastIndex');
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.array.find-last');
2
+ var entryUnbind = require('../../internals/entry-unbind');
3
+
4
+ module.exports = entryUnbind('Array', 'findLast');
@@ -2,6 +2,8 @@ var parent = require('../../es/array');
2
2
  require('../../modules/es.map');
3
3
  require('../../modules/esnext.array.at');
4
4
  require('../../modules/esnext.array.filter-out');
5
+ require('../../modules/esnext.array.find-last');
6
+ require('../../modules/esnext.array.find-last-index');
5
7
  require('../../modules/esnext.array.is-template-object');
6
8
  require('../../modules/esnext.array.last-item');
7
9
  require('../../modules/esnext.array.last-index');
@@ -0,0 +1,4 @@
1
+ require('../../../modules/esnext.array.find-last-index');
2
+ var entryVirtual = require('../../../internals/entry-virtual');
3
+
4
+ module.exports = entryVirtual('Array').findLastIndex;
@@ -0,0 +1,4 @@
1
+ require('../../../modules/esnext.array.find-last');
2
+ var entryVirtual = require('../../../internals/entry-virtual');
3
+
4
+ module.exports = entryVirtual('Array').findLast;
@@ -1,6 +1,9 @@
1
1
  var parent = require('../../../es/array/virtual');
2
+ require('../../../modules/es.map');
2
3
  require('../../../modules/esnext.array.at');
3
4
  require('../../../modules/esnext.array.filter-out');
5
+ require('../../../modules/esnext.array.find-last');
6
+ require('../../../modules/esnext.array.find-last-index');
4
7
  require('../../../modules/esnext.array.unique-by');
5
8
 
6
9
  module.exports = parent;
@@ -0,0 +1,8 @@
1
+ var findLastIndex = require('../array/virtual/find-last-index');
2
+
3
+ var ArrayPrototype = Array.prototype;
4
+
5
+ module.exports = function (it) {
6
+ var own = it.findLastIndex;
7
+ return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findLastIndex) ? findLastIndex : own;
8
+ };
@@ -0,0 +1,8 @@
1
+ var findLast = require('../array/virtual/find-last');
2
+
3
+ var ArrayPrototype = Array.prototype;
4
+
5
+ module.exports = function (it) {
6
+ var own = it.findLast;
7
+ return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.findLast) ? findLast : own;
8
+ };
@@ -0,0 +1 @@
1
+ require('../../modules/esnext.typed-array.find-last-index');
@@ -0,0 +1 @@
1
+ require('../../modules/esnext.typed-array.find-last');
@@ -1,5 +1,9 @@
1
1
  var parent = require('../../es/typed-array');
2
+ require('../../modules/es.map');
2
3
  require('../../modules/esnext.typed-array.at');
3
4
  require('../../modules/esnext.typed-array.filter-out');
5
+ require('../../modules/esnext.typed-array.find-last');
6
+ require('../../modules/esnext.typed-array.find-last-index');
7
+ require('../../modules/esnext.typed-array.unique-by');
4
8
 
5
9
  module.exports = parent;
@@ -0,0 +1,2 @@
1
+ require('../../modules/es.map');
2
+ require('../../modules/esnext.typed-array.unique-by');
@@ -122,7 +122,7 @@ for (NAME in TypedArrayConstructorsList) {
122
122
 
123
123
  // WebKit bug - typed arrays constructors prototype is Object.prototype
124
124
  if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) {
125
- // eslint-disable-next-line no-shadow
125
+ // eslint-disable-next-line no-shadow -- safe
126
126
  TypedArray = function TypedArray() {
127
127
  throw TypeError('Incorrect invocation');
128
128
  };
@@ -174,16 +174,18 @@ if (!NATIVE_ARRAY_BUFFER) {
174
174
  }
175
175
  });
176
176
  } else {
177
+ /* eslint-disable no-new -- required for testing */
177
178
  if (!fails(function () {
178
179
  NativeArrayBuffer(1);
179
180
  }) || !fails(function () {
180
- new NativeArrayBuffer(-1); // eslint-disable-line no-new
181
+ new NativeArrayBuffer(-1);
181
182
  }) || fails(function () {
182
- new NativeArrayBuffer(); // eslint-disable-line no-new
183
- new NativeArrayBuffer(1.5); // eslint-disable-line no-new
184
- new NativeArrayBuffer(NaN); // eslint-disable-line no-new
183
+ new NativeArrayBuffer();
184
+ new NativeArrayBuffer(1.5);
185
+ new NativeArrayBuffer(NaN);
185
186
  return NativeArrayBuffer.name != ARRAY_BUFFER;
186
187
  })) {
188
+ /* eslint-enable no-new -- required for testing */
187
189
  $ArrayBuffer = function ArrayBuffer(length) {
188
190
  anInstance(this, $ArrayBuffer);
189
191
  return new NativeArrayBuffer(toIndex(length));
@@ -1,13 +1,11 @@
1
1
  'use strict';
2
2
  var $forEach = require('../internals/array-iteration').forEach;
3
3
  var arrayMethodIsStrict = require('../internals/array-method-is-strict');
4
- var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
5
4
 
6
5
  var STRICT_METHOD = arrayMethodIsStrict('forEach');
7
- var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
8
6
 
9
7
  // `Array.prototype.forEach` method implementation
10
8
  // https://tc39.es/ecma262/#sec-array.prototype.foreach
11
- module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
9
+ module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
12
10
  return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
13
11
  } : [].forEach;
@@ -10,10 +10,10 @@ var createMethod = function (IS_INCLUDES) {
10
10
  var index = toAbsoluteIndex(fromIndex, length);
11
11
  var value;
12
12
  // Array#includes uses SameValueZero equality algorithm
13
- // eslint-disable-next-line no-self-compare
13
+ // eslint-disable-next-line no-self-compare -- NaN check
14
14
  if (IS_INCLUDES && el != el) while (length > index) {
15
15
  value = O[index++];
16
- // eslint-disable-next-line no-self-compare
16
+ // eslint-disable-next-line no-self-compare -- NaN check
17
17
  if (value != value) return true;
18
18
  // Array#indexOf ignores holes, Array#includes - not
19
19
  } else for (;length > index; index++) {
@@ -0,0 +1,34 @@
1
+ var bind = require('../internals/function-bind-context');
2
+ var IndexedObject = require('../internals/indexed-object');
3
+ var toObject = require('../internals/to-object');
4
+ var toLength = require('../internals/to-length');
5
+
6
+ // `Array.prototype.{ findLast, findLastIndex }` methods implementation
7
+ var createMethod = function (TYPE) {
8
+ var IS_FIND_INDEX = TYPE == 6;
9
+ return function ($this, callbackfn, that) {
10
+ var O = toObject($this);
11
+ var self = IndexedObject(O);
12
+ var boundFunction = bind(callbackfn, that, 3);
13
+ var index = toLength(self.length);
14
+ var value, result;
15
+ while (index-- > 0) {
16
+ value = self[index];
17
+ result = boundFunction(value, index, O);
18
+ if (result) switch (TYPE) {
19
+ case 5: return value; // find
20
+ case 6: return index; // findIndex
21
+ }
22
+ }
23
+ return IS_FIND_INDEX ? -1 : undefined;
24
+ };
25
+ };
26
+
27
+ module.exports = {
28
+ // `Array.prototype.findLast` method
29
+ // https://github.com/tc39/proposal-array-find-from-last
30
+ findLast: createMethod(5),
31
+ // `Array.prototype.findLastIndex` method
32
+ // https://github.com/tc39/proposal-array-find-from-last
33
+ findLastIndex: createMethod(6)
34
+ };
@@ -3,15 +3,12 @@ var toIndexedObject = require('../internals/to-indexed-object');
3
3
  var toInteger = require('../internals/to-integer');
4
4
  var toLength = require('../internals/to-length');
5
5
  var arrayMethodIsStrict = require('../internals/array-method-is-strict');
6
- var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
7
6
 
8
7
  var min = Math.min;
9
8
  var nativeLastIndexOf = [].lastIndexOf;
10
9
  var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
11
10
  var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
12
- // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
13
- var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
14
- var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
11
+ var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
15
12
 
16
13
  // `Array.prototype.lastIndexOf` method implementation
17
14
  // https://tc39.es/ecma262/#sec-array.prototype.lastindexof
@@ -4,7 +4,7 @@ var fails = require('../internals/fails');
4
4
  module.exports = function (METHOD_NAME, argument) {
5
5
  var method = [][METHOD_NAME];
6
6
  return !!method && fails(function () {
7
- // eslint-disable-next-line no-useless-call,no-throw-literal
7
+ // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
8
8
  method.call(null, argument || function () { throw 1; }, 1);
9
9
  });
10
10
  };
@@ -0,0 +1,32 @@
1
+ 'use strict';
2
+ var toLength = require('../internals/to-length');
3
+ var toObject = require('../internals/to-object');
4
+ var getBuiltIn = require('../internals/get-built-in');
5
+ var arraySpeciesCreate = require('../internals/array-species-create');
6
+
7
+ var push = [].push;
8
+
9
+ // `Array.prototype.uniqueBy` method
10
+ // https://github.com/tc39/proposal-array-unique
11
+ module.exports = function uniqueBy(resolver) {
12
+ var that = toObject(this);
13
+ var length = toLength(that.length);
14
+ var result = arraySpeciesCreate(that, 0);
15
+ var Map = getBuiltIn('Map');
16
+ var map = new Map();
17
+ var resolverFunction, index, item, key;
18
+ if (typeof resolver == 'function') resolverFunction = resolver;
19
+ else if (resolver == null) resolverFunction = function (value) {
20
+ return value;
21
+ };
22
+ else throw new TypeError('Incorrect resolver!');
23
+ for (index = 0; index < length; index++) {
24
+ item = that[index];
25
+ key = resolverFunction(item);
26
+ if (!map.has(key)) map.set(key, item);
27
+ }
28
+ map.forEach(function (value) {
29
+ push.call(result, value);
30
+ });
31
+ return result;
32
+ };
@@ -19,7 +19,7 @@ if (!IS_PURE) {
19
19
  AsyncIteratorPrototype = AsyncIterator.prototype;
20
20
  } else if (shared[USE_FUNCTION_CONSTRUCTOR] || global[USE_FUNCTION_CONSTRUCTOR]) {
21
21
  try {
22
- // eslint-disable-next-line no-new-func
22
+ // eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax
23
23
  prototype = getPrototypeOf(getPrototypeOf(getPrototypeOf(Function('return async function*(){}()')())));
24
24
  if (getPrototypeOf(prototype) === Object.prototype) AsyncIteratorPrototype = prototype;
25
25
  } catch (error) { /* empty */ }
@@ -16,7 +16,7 @@ try {
16
16
  iteratorWithReturn[ITERATOR] = function () {
17
17
  return this;
18
18
  };
19
- // eslint-disable-next-line no-throw-literal
19
+ // eslint-disable-next-line no-throw-literal -- required for testing
20
20
  Array.from(iteratorWithReturn, function () { throw 2; });
21
21
  } catch (error) { /* empty */ }
22
22
 
@@ -40,10 +40,14 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
40
40
  );
41
41
  };
42
42
 
43
- // eslint-disable-next-line max-len
44
- if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
45
- new NativeConstructor().entries().next();
46
- })))) {
43
+ var REPLACE = isForced(
44
+ CONSTRUCTOR_NAME,
45
+ typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
46
+ new NativeConstructor().entries().next();
47
+ }))
48
+ );
49
+
50
+ if (REPLACE) {
47
51
  // create collection constructor
48
52
  Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
49
53
  InternalMetadataModule.REQUIRED = true;
@@ -54,7 +58,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
54
58
  // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
55
59
  var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
56
60
  // most early implementations doesn't supports iterables, most modern - not close it correctly
57
- // eslint-disable-next-line no-new
61
+ // eslint-disable-next-line no-new -- required for testing
58
62
  var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
59
63
  // for early implementations -0 and +0 not the same
60
64
  var BUGGY_ZERO = !IS_WEAK && fails(function () {
@@ -40,6 +40,7 @@ var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
40
40
  // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
41
41
  // Weex JS has frozen built-in prototypes, so use try / catch wrapper
42
42
  var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
43
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
43
44
  var re = /(?:)/;
44
45
  var originalExec = re.exec;
45
46
  re.exec = function () { return originalExec.apply(this, arguments); };
@@ -8,7 +8,7 @@ var factories = {};
8
8
  var construct = function (C, argsLength, args) {
9
9
  if (!(argsLength in factories)) {
10
10
  for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
11
- // eslint-disable-next-line no-new-func
11
+ // eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only
12
12
  factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
13
13
  } return factories[argsLength](C, args);
14
14
  };
@@ -2,6 +2,6 @@ var IS_PURE = require('../internals/is-pure');
2
2
  var getIterator = require('../internals/get-iterator');
3
3
 
4
4
  module.exports = IS_PURE ? getIterator : function (it) {
5
- // eslint-disable-next-line no-undef
5
+ // eslint-disable-next-line no-undef -- safe
6
6
  return Map.prototype.entries.call(it);
7
7
  };
@@ -2,6 +2,6 @@ var IS_PURE = require('../internals/is-pure');
2
2
  var getIterator = require('../internals/get-iterator');
3
3
 
4
4
  module.exports = IS_PURE ? getIterator : function (it) {
5
- // eslint-disable-next-line no-undef
5
+ // eslint-disable-next-line no-undef -- safe
6
6
  return Set.prototype.values.call(it);
7
7
  };
@@ -4,10 +4,10 @@ var check = function (it) {
4
4
 
5
5
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
6
6
  module.exports =
7
- // eslint-disable-next-line no-undef
7
+ /* global globalThis -- safe */
8
8
  check(typeof globalThis == 'object' && globalThis) ||
9
9
  check(typeof window == 'object' && window) ||
10
10
  check(typeof self == 'object' && self) ||
11
11
  check(typeof global == 'object' && global) ||
12
- // eslint-disable-next-line no-new-func
12
+ // eslint-disable-next-line no-new-func -- fallback
13
13
  (function () { return this; })() || Function('return this')();
@@ -1,6 +1,4 @@
1
1
  // IEEE754 conversions based on https://github.com/feross/ieee754
2
- // eslint-disable-next-line no-shadow-restricted-names
3
- var Infinity = 1 / 0;
4
2
  var abs = Math.abs;
5
3
  var pow = Math.pow;
6
4
  var floor = Math.floor;
@@ -17,9 +15,9 @@ var pack = function (number, mantissaLength, bytes) {
17
15
  var index = 0;
18
16
  var exponent, mantissa, c;
19
17
  number = abs(number);
20
- // eslint-disable-next-line no-self-compare
18
+ // eslint-disable-next-line no-self-compare -- NaN check
21
19
  if (number != number || number === Infinity) {
22
- // eslint-disable-next-line no-self-compare
20
+ // eslint-disable-next-line no-self-compare -- NaN check
23
21
  mantissa = number != number ? 1 : 0;
24
22
  exponent = eMax;
25
23
  } else {
@@ -6,7 +6,7 @@ var split = ''.split;
6
6
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
7
7
  module.exports = fails(function () {
8
8
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
9
- // eslint-disable-next-line no-prototype-builtins
9
+ // eslint-disable-next-line no-prototype-builtins -- safe
10
10
  return !Object('z').propertyIsEnumerable(0);
11
11
  }) ? function (it) {
12
12
  return classof(it) == 'String' ? split.call(it, '') : Object(it);
@@ -8,6 +8,6 @@ module.exports = function (it) {
8
8
  var O = Object(it);
9
9
  return O[ITERATOR] !== undefined
10
10
  || '@@iterator' in O
11
- // eslint-disable-next-line no-prototype-builtins
11
+ // eslint-disable-next-line no-prototype-builtins -- safe
12
12
  || Iterators.hasOwnProperty(classof(O));
13
13
  };
@@ -20,7 +20,7 @@ module.exports = Math.fround || function fround(x) {
20
20
  if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
21
21
  a = (1 + EPSILON32 / EPSILON) * $abs;
22
22
  result = a - (a - $abs);
23
- // eslint-disable-next-line no-self-compare
23
+ // eslint-disable-next-line no-self-compare -- NaN check
24
24
  if (result > MAX32 || result != result) return $sign * Infinity;
25
25
  return $sign * result;
26
26
  };
@@ -3,13 +3,13 @@
3
3
  module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
4
4
  if (
5
5
  arguments.length === 0
6
- /* eslint-disable no-self-compare */
6
+ /* eslint-disable no-self-compare -- NaN check */
7
7
  || x != x
8
8
  || inLow != inLow
9
9
  || inHigh != inHigh
10
10
  || outLow != outLow
11
11
  || outHigh != outHigh
12
- /* eslint-enable no-self-compare */
12
+ /* eslint-enable no-self-compare -- NaN check */
13
13
  ) return NaN;
14
14
  if (x === Infinity || x === -Infinity) return x;
15
15
  return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
@@ -1,6 +1,6 @@
1
1
  // `Math.sign` method implementation
2
2
  // https://tc39.es/ecma262/#sec-math.sign
3
3
  module.exports = Math.sign || function sign(x) {
4
- // eslint-disable-next-line no-self-compare
4
+ // eslint-disable-next-line no-self-compare -- NaN check
5
5
  return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
6
6
  };
@@ -2,6 +2,6 @@ var fails = require('../internals/fails');
2
2
 
3
3
  module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
4
4
  // Chrome 38 Symbol has incorrect toString conversion
5
- // eslint-disable-next-line no-undef
5
+ /* global Symbol -- required for testing */
6
6
  return !String(Symbol());
7
7
  });
@@ -26,13 +26,13 @@ module.exports = !nativeAssign || fails(function () {
26
26
  // should work with symbols and should have deterministic property order (V8 bug)
27
27
  var A = {};
28
28
  var B = {};
29
- // eslint-disable-next-line no-undef
29
+ /* global Symbol -- required for testing */
30
30
  var symbol = Symbol();
31
31
  var alphabet = 'abcdefghijklmnopqrst';
32
32
  A[symbol] = 7;
33
33
  alphabet.split('').forEach(function (chr) { B[chr] = chr; });
34
34
  return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
35
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
35
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
36
36
  var T = toObject(target);
37
37
  var argumentsLength = arguments.length;
38
38
  var index = 1;
@@ -52,7 +52,7 @@ var NullProtoObjectViaIFrame = function () {
52
52
  var activeXDocument;
53
53
  var NullProtoObject = function () {
54
54
  try {
55
- /* global ActiveXObject */
55
+ /* global ActiveXObject -- old IE */
56
56
  activeXDocument = document.domain && new ActiveXObject('htmlfile');
57
57
  } catch (error) { /* ignore */ }
58
58
  NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
@@ -7,7 +7,7 @@ var fails = require('../internals/fails');
7
7
  module.exports = IS_PURE || !fails(function () {
8
8
  var key = Math.random();
9
9
  // In FF throws only define methods
10
- // eslint-disable-next-line no-undef, no-useless-call
10
+ // eslint-disable-next-line no-undef, no-useless-call -- required for testing
11
11
  __defineSetter__.call(null, key, function () { /* empty */ });
12
12
  delete global[key];
13
13
  });
@@ -1,10 +1,10 @@
1
+ /* eslint-disable no-proto -- safe */
1
2
  var anObject = require('../internals/an-object');
2
3
  var aPossiblePrototype = require('../internals/a-possible-prototype');
3
4
 
4
5
  // `Object.setPrototypeOf` method
5
6
  // https://tc39.es/ecma262/#sec-object.setprototypeof
6
7
  // Works with __proto__ only. Old v8 can't work with null proto objects.
7
- /* eslint-disable no-proto */
8
8
  module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
9
9
  var CORRECT_SETTER = false;
10
10
  var test = {};
@@ -40,7 +40,7 @@ var $RangeIterator = createIteratorConstructor(function RangeIterator(start, end
40
40
  if (step === Infinity || step === -Infinity || (step === zero && start !== end)) {
41
41
  throw new RangeError(INCORRECT_RANGE);
42
42
  }
43
- // eslint-disable-next-line no-self-compare
43
+ // eslint-disable-next-line no-self-compare -- NaN check
44
44
  var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero);
45
45
  setInternalState(this, {
46
46
  type: RANGE_ITERATOR,
@@ -21,6 +21,7 @@ var UPDATES_LAST_INDEX_WRONG = (function () {
21
21
  var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
22
22
 
23
23
  // nonparticipating capturing group, copied from es5-shim's String#split patch.
24
+ // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing
24
25
  var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
25
26
 
26
27
  var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
@@ -1,6 +1,6 @@
1
1
  // `SameValueZero` abstract operation
2
2
  // https://tc39.es/ecma262/#sec-samevaluezero
3
3
  module.exports = function (x, y) {
4
- // eslint-disable-next-line no-self-compare
4
+ // eslint-disable-next-line no-self-compare -- NaN check
5
5
  return x === y || x != x && y != y;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  // `SameValue` abstract operation
2
2
  // https://tc39.es/ecma262/#sec-samevalue
3
3
  module.exports = Object.is || function is(x, y) {
4
- // eslint-disable-next-line no-self-compare
4
+ // eslint-disable-next-line no-self-compare -- NaN check
5
5
  return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
6
6
  };
@@ -4,7 +4,7 @@ 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.8.3',
7
+ version: '3.9.0',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -1,5 +1,5 @@
1
1
  // https://github.com/zloirock/core-js/issues/280
2
2
  var userAgent = require('../internals/engine-user-agent');
3
3
 
4
- // eslint-disable-next-line unicorn/no-unsafe-regex
4
+ // eslint-disable-next-line unicorn/no-unsafe-regex -- safe
5
5
  module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
@@ -74,7 +74,7 @@ var adapt = function (delta, numPoints, firstTime) {
74
74
  * Converts a string of Unicode symbols (e.g. a domain name label) to a
75
75
  * Punycode string of ASCII-only symbols.
76
76
  */
77
- // eslint-disable-next-line max-statements
77
+ // eslint-disable-next-line max-statements -- TODO
78
78
  var encode = function (input) {
79
79
  var output = [];
80
80
 
package/internals/task.js CHANGED
@@ -18,7 +18,7 @@ var ONREADYSTATECHANGE = 'onreadystatechange';
18
18
  var defer, channel, port;
19
19
 
20
20
  var run = function (id) {
21
- // eslint-disable-next-line no-prototype-builtins
21
+ // eslint-disable-next-line no-prototype-builtins -- safe
22
22
  if (queue.hasOwnProperty(id)) {
23
23
  var fn = queue[id];
24
24
  delete queue[id];
@@ -48,7 +48,7 @@ if (!set || !clear) {
48
48
  var i = 1;
49
49
  while (arguments.length > i) args.push(arguments[i++]);
50
50
  queue[++counter] = function () {
51
- // eslint-disable-next-line no-new-func
51
+ // eslint-disable-next-line no-new-func -- spec requirement
52
52
  (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
53
53
  };
54
54
  defer(counter);
@@ -1,4 +1,4 @@
1
- /* eslint-disable no-new */
1
+ /* eslint-disable no-new -- required for testing */
2
2
  var global = require('../internals/global');
3
3
  var fails = require('../internals/fails');
4
4
  var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
@@ -0,0 +1,11 @@
1
+ var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;
2
+ var speciesConstructor = require('../internals/species-constructor');
3
+
4
+ module.exports = function (instance, list) {
5
+ var C = speciesConstructor(instance, instance.constructor);
6
+ var index = 0;
7
+ var length = list.length;
8
+ var result = new (aTypedArrayConstructor(C))(length);
9
+ while (length > index) result[index] = list[index++];
10
+ return result;
11
+ };
@@ -1,7 +1,6 @@
1
1
  var NATIVE_SYMBOL = require('../internals/native-symbol');
2
2
 
3
3
  module.exports = NATIVE_SYMBOL
4
- // eslint-disable-next-line no-undef
4
+ /* global Symbol -- safe */
5
5
  && !Symbol.sham
6
- // eslint-disable-next-line no-undef
7
6
  && typeof Symbol.iterator == 'symbol';
@@ -1,3 +1,3 @@
1
1
  // a string of all valid unicode whitespaces
2
- // eslint-disable-next-line max-len
3
- module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
2
+ module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
3
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';