core-js 3.9.0 → 3.10.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 (96) hide show
  1. package/es/index.js +96 -97
  2. package/es/json/index.js +1 -0
  3. package/es/json/stringify.js +1 -0
  4. package/features/index.js +353 -2
  5. package/index.js +1 -6
  6. package/internals/array-buffer-native.js +1 -0
  7. package/internals/array-buffer.js +3 -3
  8. package/internals/array-copy-within.js +1 -0
  9. package/internals/array-for-each.js +1 -0
  10. package/internals/array-last-index-of.js +5 -4
  11. package/internals/check-correctness-of-iteration.js +1 -1
  12. package/internals/correct-prototype-getter.js +1 -0
  13. package/internals/descriptors.js +1 -0
  14. package/internals/engine-is-ios.js +1 -1
  15. package/internals/fix-regexp-well-known-symbol-logic.js +2 -2
  16. package/internals/freezing.js +1 -0
  17. package/internals/get-map-iterator.js +1 -1
  18. package/internals/get-set-iterator.js +1 -1
  19. package/internals/get-substitution.js +2 -2
  20. package/internals/global.js +2 -1
  21. package/internals/ie8-dom-define.js +1 -0
  22. package/internals/internal-metadata.js +1 -0
  23. package/internals/internal-state.js +3 -0
  24. package/internals/is-array.js +1 -0
  25. package/internals/iterators-core.js +1 -0
  26. package/internals/math-expm1.js +6 -5
  27. package/internals/math-fround.js +1 -0
  28. package/internals/math-log1p.js +1 -0
  29. package/internals/math-sign.js +1 -0
  30. package/internals/native-symbol.js +8 -3
  31. package/internals/number-is-finite.js +1 -0
  32. package/internals/{range-iterator.js → numeric-range-iterator.js} +5 -5
  33. package/internals/object-assign.js +8 -6
  34. package/internals/object-define-properties.js +1 -0
  35. package/internals/object-define-property.js +4 -3
  36. package/internals/object-get-own-property-descriptor.js +4 -3
  37. package/internals/object-get-own-property-names-external.js +4 -3
  38. package/internals/object-get-own-property-names.js +1 -0
  39. package/internals/object-get-own-property-symbols.js +1 -0
  40. package/internals/object-get-prototype-of.js +1 -0
  41. package/internals/object-keys.js +1 -0
  42. package/internals/object-property-is-enumerable.js +4 -3
  43. package/internals/object-set-prototype-of.js +2 -0
  44. package/internals/regexp-exec.js +3 -5
  45. package/internals/same-value.js +1 -0
  46. package/internals/shared.js +1 -1
  47. package/internals/string-pad-webkit-bug.js +1 -1
  48. package/internals/string-repeat.js +1 -1
  49. package/internals/use-symbol-as-uid.js +1 -1
  50. package/internals/well-known-symbol.js +6 -3
  51. package/modules/es.array.for-each.js +1 -0
  52. package/modules/es.array.from.js +1 -0
  53. package/modules/es.array.index-of.js +1 -0
  54. package/modules/es.array.last-index-of.js +1 -0
  55. package/modules/es.array.of.js +1 -0
  56. package/modules/es.math.acosh.js +5 -4
  57. package/modules/es.math.asinh.js +3 -2
  58. package/modules/es.math.atanh.js +3 -2
  59. package/modules/es.math.cosh.js +3 -2
  60. package/modules/es.math.expm1.js +1 -0
  61. package/modules/es.math.hypot.js +1 -0
  62. package/modules/es.math.imul.js +3 -2
  63. package/modules/es.math.sinh.js +1 -0
  64. package/modules/es.number.parse-float.js +1 -0
  65. package/modules/es.number.parse-int.js +1 -0
  66. package/modules/es.object.assign.js +1 -0
  67. package/modules/es.object.freeze.js +4 -3
  68. package/modules/es.object.get-own-property-names.js +3 -2
  69. package/modules/es.object.is-extensible.js +4 -3
  70. package/modules/es.object.is-frozen.js +4 -3
  71. package/modules/es.object.is-sealed.js +4 -3
  72. package/modules/es.object.prevent-extensions.js +4 -3
  73. package/modules/es.object.seal.js +4 -3
  74. package/modules/es.reflect.define-property.js +1 -1
  75. package/modules/es.reflect.is-extensible.js +1 -0
  76. package/modules/es.reflect.set.js +1 -1
  77. package/modules/es.regexp.flags.js +1 -0
  78. package/modules/es.string.ends-with.js +4 -3
  79. package/modules/es.string.from-code-point.js +3 -2
  80. package/modules/es.string.match-all.js +1 -0
  81. package/modules/es.string.split.js +8 -10
  82. package/modules/es.string.starts-with.js +4 -3
  83. package/modules/es.string.trim-end.js +1 -0
  84. package/modules/es.string.trim-start.js +1 -0
  85. package/modules/es.typed-array.set.js +1 -1
  86. package/modules/es.typed-array.slice.js +1 -1
  87. package/modules/es.weak-map.js +1 -0
  88. package/modules/esnext.array.is-template-object.js +1 -0
  89. package/modules/esnext.bigint.range.js +3 -3
  90. package/modules/esnext.number.range.js +2 -2
  91. package/modules/esnext.observable.js +7 -8
  92. package/modules/web.url.js +1 -1
  93. package/package.json +4 -3
  94. package/stable/index.js +220 -4
  95. package/stage/1.js +0 -1
  96. package/stage/2.js +1 -0
@@ -10,8 +10,11 @@ var Symbol = global.Symbol;
10
10
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
11
11
 
12
12
  module.exports = function (name) {
13
- if (!has(WellKnownSymbolsStore, name)) {
14
- if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name];
15
- else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
13
+ if (!has(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
14
+ if (NATIVE_SYMBOL && has(Symbol, name)) {
15
+ WellKnownSymbolsStore[name] = Symbol[name];
16
+ } else {
17
+ WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
18
+ }
16
19
  } return WellKnownSymbolsStore[name];
17
20
  };
@@ -4,6 +4,7 @@ var forEach = require('../internals/array-for-each');
4
4
 
5
5
  // `Array.prototype.forEach` method
6
6
  // https://tc39.es/ecma262/#sec-array.prototype.foreach
7
+ // eslint-disable-next-line es/no-array-prototype-foreach -- safe
7
8
  $({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
8
9
  forEach: forEach
9
10
  });
@@ -3,6 +3,7 @@ var from = require('../internals/array-from');
3
3
  var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
4
4
 
5
5
  var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
6
+ // eslint-disable-next-line es/no-array-from -- required for testing
6
7
  Array.from(iterable);
7
8
  });
8
9
 
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ /* eslint-disable es/no-array-prototype-indexof -- required for testing */
2
3
  var $ = require('../internals/export');
3
4
  var $indexOf = require('../internals/array-includes').indexOf;
4
5
  var arrayMethodIsStrict = require('../internals/array-method-is-strict');
@@ -3,6 +3,7 @@ var lastIndexOf = require('../internals/array-last-index-of');
3
3
 
4
4
  // `Array.prototype.lastIndexOf` method
5
5
  // https://tc39.es/ecma262/#sec-array.prototype.lastindexof
6
+ // eslint-disable-next-line es/no-array-prototype-lastindexof -- required for testing
6
7
  $({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, {
7
8
  lastIndexOf: lastIndexOf
8
9
  });
@@ -5,6 +5,7 @@ var createProperty = require('../internals/create-property');
5
5
 
6
6
  var ISNT_GENERIC = fails(function () {
7
7
  function F() { /* empty */ }
8
+ // eslint-disable-next-line es/no-array-of -- required for testing
8
9
  return !(Array.of.call(F) instanceof F);
9
10
  });
10
11
 
@@ -1,16 +1,17 @@
1
1
  var $ = require('../internals/export');
2
2
  var log1p = require('../internals/math-log1p');
3
3
 
4
- var nativeAcosh = Math.acosh;
4
+ // eslint-disable-next-line es/no-math-acosh -- required for testing
5
+ var $acosh = Math.acosh;
5
6
  var log = Math.log;
6
7
  var sqrt = Math.sqrt;
7
8
  var LN2 = Math.LN2;
8
9
 
9
- var FORCED = !nativeAcosh
10
+ var FORCED = !$acosh
10
11
  // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
11
- || Math.floor(nativeAcosh(Number.MAX_VALUE)) != 710
12
+ || Math.floor($acosh(Number.MAX_VALUE)) != 710
12
13
  // Tor Browser bug: Math.acosh(Infinity) -> NaN
13
- || nativeAcosh(Infinity) != Infinity;
14
+ || $acosh(Infinity) != Infinity;
14
15
 
15
16
  // `Math.acosh` method
16
17
  // https://tc39.es/ecma262/#sec-math.acosh
@@ -1,6 +1,7 @@
1
1
  var $ = require('../internals/export');
2
2
 
3
- var nativeAsinh = Math.asinh;
3
+ // eslint-disable-next-line es/no-math-asinh -- required for testing
4
+ var $asinh = Math.asinh;
4
5
  var log = Math.log;
5
6
  var sqrt = Math.sqrt;
6
7
 
@@ -11,6 +12,6 @@ function asinh(x) {
11
12
  // `Math.asinh` method
12
13
  // https://tc39.es/ecma262/#sec-math.asinh
13
14
  // Tor Browser bug: Math.asinh(0) -> -0
14
- $({ target: 'Math', stat: true, forced: !(nativeAsinh && 1 / nativeAsinh(0) > 0) }, {
15
+ $({ target: 'Math', stat: true, forced: !($asinh && 1 / $asinh(0) > 0) }, {
15
16
  asinh: asinh
16
17
  });
@@ -1,12 +1,13 @@
1
1
  var $ = require('../internals/export');
2
2
 
3
- var nativeAtanh = Math.atanh;
3
+ // eslint-disable-next-line es/no-math-atanh -- required for testing
4
+ var $atanh = Math.atanh;
4
5
  var log = Math.log;
5
6
 
6
7
  // `Math.atanh` method
7
8
  // https://tc39.es/ecma262/#sec-math.atanh
8
9
  // Tor Browser bug: Math.atanh(-0) -> 0
9
- $({ target: 'Math', stat: true, forced: !(nativeAtanh && 1 / nativeAtanh(-0) < 0) }, {
10
+ $({ target: 'Math', stat: true, forced: !($atanh && 1 / $atanh(-0) < 0) }, {
10
11
  atanh: function atanh(x) {
11
12
  return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2;
12
13
  }
@@ -1,13 +1,14 @@
1
1
  var $ = require('../internals/export');
2
2
  var expm1 = require('../internals/math-expm1');
3
3
 
4
- var nativeCosh = Math.cosh;
4
+ // eslint-disable-next-line es/no-math-cosh -- required for testing
5
+ var $cosh = Math.cosh;
5
6
  var abs = Math.abs;
6
7
  var E = Math.E;
7
8
 
8
9
  // `Math.cosh` method
9
10
  // https://tc39.es/ecma262/#sec-math.cosh
10
- $({ target: 'Math', stat: true, forced: !nativeCosh || nativeCosh(710) === Infinity }, {
11
+ $({ target: 'Math', stat: true, forced: !$cosh || $cosh(710) === Infinity }, {
11
12
  cosh: function cosh(x) {
12
13
  var t = expm1(abs(x) - 1) + 1;
13
14
  return (t + 1 / (t * E * E)) * (E / 2);
@@ -3,4 +3,5 @@ var expm1 = require('../internals/math-expm1');
3
3
 
4
4
  // `Math.expm1` method
5
5
  // https://tc39.es/ecma262/#sec-math.expm1
6
+ // eslint-disable-next-line es/no-math-expm1 -- required for testing
6
7
  $({ target: 'Math', stat: true, forced: expm1 != Math.expm1 }, { expm1: expm1 });
@@ -1,5 +1,6 @@
1
1
  var $ = require('../internals/export');
2
2
 
3
+ // eslint-disable-next-line es/no-math-hypot -- required for testing
3
4
  var $hypot = Math.hypot;
4
5
  var abs = Math.abs;
5
6
  var sqrt = Math.sqrt;
@@ -1,10 +1,11 @@
1
1
  var $ = require('../internals/export');
2
2
  var fails = require('../internals/fails');
3
3
 
4
- var nativeImul = Math.imul;
4
+ // eslint-disable-next-line es/no-math-imul -- required for testing
5
+ var $imul = Math.imul;
5
6
 
6
7
  var FORCED = fails(function () {
7
- return nativeImul(0xFFFFFFFF, 5) != -5 || nativeImul.length != 2;
8
+ return $imul(0xFFFFFFFF, 5) != -5 || $imul.length != 2;
8
9
  });
9
10
 
10
11
  // `Math.imul` method
@@ -7,6 +7,7 @@ var exp = Math.exp;
7
7
  var E = Math.E;
8
8
 
9
9
  var FORCED = fails(function () {
10
+ // eslint-disable-next-line es/no-math-sinh -- required for testing
10
11
  return Math.sinh(-2e-17) != -2e-17;
11
12
  });
12
13
 
@@ -3,6 +3,7 @@ var parseFloat = require('../internals/number-parse-float');
3
3
 
4
4
  // `Number.parseFloat` method
5
5
  // https://tc39.es/ecma262/#sec-number.parseFloat
6
+ // eslint-disable-next-line es/no-number-parsefloat -- required for testing
6
7
  $({ target: 'Number', stat: true, forced: Number.parseFloat != parseFloat }, {
7
8
  parseFloat: parseFloat
8
9
  });
@@ -3,6 +3,7 @@ var parseInt = require('../internals/number-parse-int');
3
3
 
4
4
  // `Number.parseInt` method
5
5
  // https://tc39.es/ecma262/#sec-number.parseint
6
+ // eslint-disable-next-line es/no-number-parseint -- required for testing
6
7
  $({ target: 'Number', stat: true, forced: Number.parseInt != parseInt }, {
7
8
  parseInt: parseInt
8
9
  });
@@ -3,6 +3,7 @@ var assign = require('../internals/object-assign');
3
3
 
4
4
  // `Object.assign` method
5
5
  // https://tc39.es/ecma262/#sec-object.assign
6
+ // eslint-disable-next-line es/no-object-assign -- required for testing
6
7
  $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
7
8
  assign: assign
8
9
  });
@@ -4,13 +4,14 @@ var fails = require('../internals/fails');
4
4
  var isObject = require('../internals/is-object');
5
5
  var onFreeze = require('../internals/internal-metadata').onFreeze;
6
6
 
7
- var nativeFreeze = Object.freeze;
8
- var FAILS_ON_PRIMITIVES = fails(function () { nativeFreeze(1); });
7
+ // eslint-disable-next-line es/no-object-freeze -- safe
8
+ var $freeze = Object.freeze;
9
+ var FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); });
9
10
 
10
11
  // `Object.freeze` method
11
12
  // https://tc39.es/ecma262/#sec-object.freeze
12
13
  $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
13
14
  freeze: function freeze(it) {
14
- return nativeFreeze && isObject(it) ? nativeFreeze(onFreeze(it)) : it;
15
+ return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;
15
16
  }
16
17
  });
@@ -1,11 +1,12 @@
1
1
  var $ = require('../internals/export');
2
2
  var fails = require('../internals/fails');
3
- var nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names-external').f;
3
+ var getOwnPropertyNames = require('../internals/object-get-own-property-names-external').f;
4
4
 
5
+ // eslint-disable-next-line es/no-object-getownpropertynames -- required for testing
5
6
  var FAILS_ON_PRIMITIVES = fails(function () { return !Object.getOwnPropertyNames(1); });
6
7
 
7
8
  // `Object.getOwnPropertyNames` method
8
9
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
9
10
  $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
10
- getOwnPropertyNames: nativeGetOwnPropertyNames
11
+ getOwnPropertyNames: getOwnPropertyNames
11
12
  });
@@ -2,13 +2,14 @@ var $ = require('../internals/export');
2
2
  var fails = require('../internals/fails');
3
3
  var isObject = require('../internals/is-object');
4
4
 
5
- var nativeIsExtensible = Object.isExtensible;
6
- var FAILS_ON_PRIMITIVES = fails(function () { nativeIsExtensible(1); });
5
+ // eslint-disable-next-line es/no-object-isextensible -- safe
6
+ var $isExtensible = Object.isExtensible;
7
+ var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
7
8
 
8
9
  // `Object.isExtensible` method
9
10
  // https://tc39.es/ecma262/#sec-object.isextensible
10
11
  $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
11
12
  isExtensible: function isExtensible(it) {
12
- return isObject(it) ? nativeIsExtensible ? nativeIsExtensible(it) : true : false;
13
+ return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
13
14
  }
14
15
  });
@@ -2,13 +2,14 @@ var $ = require('../internals/export');
2
2
  var fails = require('../internals/fails');
3
3
  var isObject = require('../internals/is-object');
4
4
 
5
- var nativeIsFrozen = Object.isFrozen;
6
- var FAILS_ON_PRIMITIVES = fails(function () { nativeIsFrozen(1); });
5
+ // eslint-disable-next-line es/no-object-isfrozen -- safe
6
+ var $isFrozen = Object.isFrozen;
7
+ var FAILS_ON_PRIMITIVES = fails(function () { $isFrozen(1); });
7
8
 
8
9
  // `Object.isFrozen` method
9
10
  // https://tc39.es/ecma262/#sec-object.isfrozen
10
11
  $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
11
12
  isFrozen: function isFrozen(it) {
12
- return isObject(it) ? nativeIsFrozen ? nativeIsFrozen(it) : false : true;
13
+ return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
13
14
  }
14
15
  });
@@ -2,13 +2,14 @@ var $ = require('../internals/export');
2
2
  var fails = require('../internals/fails');
3
3
  var isObject = require('../internals/is-object');
4
4
 
5
- var nativeIsSealed = Object.isSealed;
6
- var FAILS_ON_PRIMITIVES = fails(function () { nativeIsSealed(1); });
5
+ // eslint-disable-next-line es/no-object-issealed -- safe
6
+ var $isSealed = Object.isSealed;
7
+ var FAILS_ON_PRIMITIVES = fails(function () { $isSealed(1); });
7
8
 
8
9
  // `Object.isSealed` method
9
10
  // https://tc39.es/ecma262/#sec-object.issealed
10
11
  $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
11
12
  isSealed: function isSealed(it) {
12
- return isObject(it) ? nativeIsSealed ? nativeIsSealed(it) : false : true;
13
+ return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
13
14
  }
14
15
  });
@@ -4,13 +4,14 @@ var onFreeze = require('../internals/internal-metadata').onFreeze;
4
4
  var FREEZING = require('../internals/freezing');
5
5
  var fails = require('../internals/fails');
6
6
 
7
- var nativePreventExtensions = Object.preventExtensions;
8
- var FAILS_ON_PRIMITIVES = fails(function () { nativePreventExtensions(1); });
7
+ // eslint-disable-next-line es/no-object-preventextensions -- safe
8
+ var $preventExtensions = Object.preventExtensions;
9
+ var FAILS_ON_PRIMITIVES = fails(function () { $preventExtensions(1); });
9
10
 
10
11
  // `Object.preventExtensions` method
11
12
  // https://tc39.es/ecma262/#sec-object.preventextensions
12
13
  $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
13
14
  preventExtensions: function preventExtensions(it) {
14
- return nativePreventExtensions && isObject(it) ? nativePreventExtensions(onFreeze(it)) : it;
15
+ return $preventExtensions && isObject(it) ? $preventExtensions(onFreeze(it)) : it;
15
16
  }
16
17
  });
@@ -4,13 +4,14 @@ var onFreeze = require('../internals/internal-metadata').onFreeze;
4
4
  var FREEZING = require('../internals/freezing');
5
5
  var fails = require('../internals/fails');
6
6
 
7
- var nativeSeal = Object.seal;
8
- var FAILS_ON_PRIMITIVES = fails(function () { nativeSeal(1); });
7
+ // eslint-disable-next-line es/no-object-seal -- safe
8
+ var $seal = Object.seal;
9
+ var FAILS_ON_PRIMITIVES = fails(function () { $seal(1); });
9
10
 
10
11
  // `Object.seal` method
11
12
  // https://tc39.es/ecma262/#sec-object.seal
12
13
  $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
13
14
  seal: function seal(it) {
14
- return nativeSeal && isObject(it) ? nativeSeal(onFreeze(it)) : it;
15
+ return $seal && isObject(it) ? $seal(onFreeze(it)) : it;
15
16
  }
16
17
  });
@@ -7,7 +7,7 @@ var fails = require('../internals/fails');
7
7
 
8
8
  // MS Edge has broken Reflect.defineProperty - throwing instead of returning false
9
9
  var ERROR_INSTEAD_OF_FALSE = fails(function () {
10
- /* global Reflect -- required for testing */
10
+ // eslint-disable-next-line es/no-reflect -- required for testing
11
11
  Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 });
12
12
  });
13
13
 
@@ -1,6 +1,7 @@
1
1
  var $ = require('../internals/export');
2
2
  var anObject = require('../internals/an-object');
3
3
 
4
+ // eslint-disable-next-line es/no-object-isextensible -- safe
4
5
  var objectIsExtensible = Object.isExtensible;
5
6
 
6
7
  // `Reflect.isExtensible` method
@@ -37,7 +37,7 @@ function set(target, propertyKey, V /* , receiver */) {
37
37
  var MS_EDGE_BUG = fails(function () {
38
38
  var Constructor = function () { /* empty */ };
39
39
  var object = definePropertyModule.f(new Constructor(), 'a', { configurable: true });
40
- /* global Reflect -- required for testing */
40
+ // eslint-disable-next-line es/no-reflect -- required for testing
41
41
  return Reflect.set(Constructor.prototype, 'a', 1, object) !== false;
42
42
  });
43
43
 
@@ -5,6 +5,7 @@ var UNSUPPORTED_Y = require('../internals/regexp-sticky-helpers').UNSUPPORTED_Y;
5
5
 
6
6
  // `RegExp.prototype.flags` getter
7
7
  // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
8
+ // eslint-disable-next-line es/no-regexp-prototype-flags -- required for testing
8
9
  if (DESCRIPTORS && (/./g.flags != 'g' || UNSUPPORTED_Y)) {
9
10
  objectDefinePropertyModule.f(RegExp.prototype, 'flags', {
10
11
  configurable: true,
@@ -7,7 +7,8 @@ var requireObjectCoercible = require('../internals/require-object-coercible');
7
7
  var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');
8
8
  var IS_PURE = require('../internals/is-pure');
9
9
 
10
- var nativeEndsWith = ''.endsWith;
10
+ // eslint-disable-next-line es/no-string-prototype-endswith -- safe
11
+ var $endsWith = ''.endsWith;
11
12
  var min = Math.min;
12
13
 
13
14
  var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
@@ -27,8 +28,8 @@ $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGE
27
28
  var len = toLength(that.length);
28
29
  var end = endPosition === undefined ? len : min(toLength(endPosition), len);
29
30
  var search = String(searchString);
30
- return nativeEndsWith
31
- ? nativeEndsWith.call(that, search, end)
31
+ return $endsWith
32
+ ? $endsWith.call(that, search, end)
32
33
  : that.slice(end - search.length, end) === search;
33
34
  }
34
35
  });
@@ -2,10 +2,11 @@ var $ = require('../internals/export');
2
2
  var toAbsoluteIndex = require('../internals/to-absolute-index');
3
3
 
4
4
  var fromCharCode = String.fromCharCode;
5
- var nativeFromCodePoint = String.fromCodePoint;
5
+ // eslint-disable-next-line es/no-string-fromcodepoint -- required for testing
6
+ var $fromCodePoint = String.fromCodePoint;
6
7
 
7
8
  // length should be 1, old FF problem
8
- var INCORRECT_LENGTH = !!nativeFromCodePoint && nativeFromCodePoint.length != 1;
9
+ var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1;
9
10
 
10
11
  // `String.fromCodePoint` method
11
12
  // https://tc39.es/ecma262/#sec-string.fromcodepoint
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ /* eslint-disable es/no-string-prototype-matchall -- safe */
2
3
  var $ = require('../internals/export');
3
4
  var createIteratorConstructor = require('../internals/create-iterator-constructor');
4
5
  var requireObjectCoercible = require('../internals/require-object-coercible');
@@ -8,15 +8,13 @@ var advanceStringIndex = require('../internals/advance-string-index');
8
8
  var toLength = require('../internals/to-length');
9
9
  var callRegExpExec = require('../internals/regexp-exec-abstract');
10
10
  var regexpExec = require('../internals/regexp-exec');
11
- var fails = require('../internals/fails');
11
+ var stickyHelpers = require('../internals/regexp-sticky-helpers');
12
12
 
13
+ var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
13
14
  var arrayPush = [].push;
14
15
  var min = Math.min;
15
16
  var MAX_UINT32 = 0xFFFFFFFF;
16
17
 
17
- // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
18
- var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
19
-
20
18
  // @@split logic
21
19
  fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
22
20
  var internalSplit;
@@ -99,11 +97,11 @@ fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCal
99
97
  var flags = (rx.ignoreCase ? 'i' : '') +
100
98
  (rx.multiline ? 'm' : '') +
101
99
  (rx.unicode ? 'u' : '') +
102
- (SUPPORTS_Y ? 'y' : 'g');
100
+ (UNSUPPORTED_Y ? 'g' : 'y');
103
101
 
104
102
  // ^(? + rx + ) is needed, in combination with some S slicing, to
105
103
  // simulate the 'y' flag.
106
- var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
104
+ var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
107
105
  var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
108
106
  if (lim === 0) return [];
109
107
  if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
@@ -111,12 +109,12 @@ fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCal
111
109
  var q = 0;
112
110
  var A = [];
113
111
  while (q < S.length) {
114
- splitter.lastIndex = SUPPORTS_Y ? q : 0;
115
- var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
112
+ splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
113
+ var z = callRegExpExec(splitter, UNSUPPORTED_Y ? S.slice(q) : S);
116
114
  var e;
117
115
  if (
118
116
  z === null ||
119
- (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
117
+ (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
120
118
  ) {
121
119
  q = advanceStringIndex(S, q, unicodeMatching);
122
120
  } else {
@@ -133,4 +131,4 @@ fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCal
133
131
  return A;
134
132
  }
135
133
  ];
136
- }, !SUPPORTS_Y);
134
+ }, UNSUPPORTED_Y);
@@ -7,7 +7,8 @@ var requireObjectCoercible = require('../internals/require-object-coercible');
7
7
  var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');
8
8
  var IS_PURE = require('../internals/is-pure');
9
9
 
10
- var nativeStartsWith = ''.startsWith;
10
+ // eslint-disable-next-line es/no-string-prototype-startswith -- safe
11
+ var $startsWith = ''.startsWith;
11
12
  var min = Math.min;
12
13
 
13
14
  var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
@@ -25,8 +26,8 @@ $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGE
25
26
  notARegExp(searchString);
26
27
  var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
27
28
  var search = String(searchString);
28
- return nativeStartsWith
29
- ? nativeStartsWith.call(that, search, index)
29
+ return $startsWith
30
+ ? $startsWith.call(that, search, index)
30
31
  : that.slice(index, index + search.length) === search;
31
32
  }
32
33
  });
@@ -7,6 +7,7 @@ var FORCED = forcedStringTrimMethod('trimEnd');
7
7
 
8
8
  var trimEnd = FORCED ? function trimEnd() {
9
9
  return $trimEnd(this);
10
+ // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
10
11
  } : ''.trimEnd;
11
12
 
12
13
  // `String.prototype.{ trimEnd, trimRight }` methods
@@ -7,6 +7,7 @@ var FORCED = forcedStringTrimMethod('trimStart');
7
7
 
8
8
  var trimStart = FORCED ? function trimStart() {
9
9
  return $trimStart(this);
10
+ // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
10
11
  } : ''.trimStart;
11
12
 
12
13
  // `String.prototype.{ trimStart, trimLeft }` methods
@@ -9,7 +9,7 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;
9
9
  var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
10
10
 
11
11
  var FORCED = fails(function () {
12
- /* global Int8Array -- safe */
12
+ // eslint-disable-next-line es/no-typed-arrays -- required for testing
13
13
  new Int8Array(1).set({});
14
14
  });
15
15
 
@@ -9,7 +9,7 @@ var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
9
9
  var $slice = [].slice;
10
10
 
11
11
  var FORCED = fails(function () {
12
- /* global Int8Array -- safe */
12
+ // eslint-disable-next-line es/no-typed-arrays -- required for testing
13
13
  new Int8Array(1).slice();
14
14
  });
15
15
 
@@ -9,6 +9,7 @@ var enforceIternalState = require('../internals/internal-state').enforce;
9
9
  var NATIVE_WEAK_MAP = require('../internals/native-weak-map');
10
10
 
11
11
  var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
12
+ // eslint-disable-next-line es/no-object-isextensible -- safe
12
13
  var isExtensible = Object.isExtensible;
13
14
  var InternalWeakMap;
14
15
 
@@ -1,6 +1,7 @@
1
1
  var $ = require('../internals/export');
2
2
  var isArray = require('../internals/is-array');
3
3
 
4
+ // eslint-disable-next-line es/no-object-isfrozen -- safe
4
5
  var isFrozen = Object.isFrozen;
5
6
 
6
7
  var isFrozenStringArray = function (array, allowUndefined) {
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
+ /* eslint-disable es/no-bigint -- safe */
2
3
  var $ = require('../internals/export');
3
- var RangeIterator = require('../internals/range-iterator');
4
+ var NumericRangeIterator = require('../internals/numeric-range-iterator');
4
5
 
5
6
  // `BigInt.range` method
6
7
  // https://github.com/tc39/proposal-Number.range
7
8
  if (typeof BigInt == 'function') {
8
9
  $({ target: 'BigInt', stat: true }, {
9
10
  range: function range(start, end, option) {
10
- /* global BigInt -- safe */
11
- return new RangeIterator(start, end, option, 'bigint', BigInt(0), BigInt(1));
11
+ return new NumericRangeIterator(start, end, option, 'bigint', BigInt(0), BigInt(1));
12
12
  }
13
13
  });
14
14
  }
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
- var RangeIterator = require('../internals/range-iterator');
3
+ var NumericRangeIterator = require('../internals/numeric-range-iterator');
4
4
 
5
5
  // `Number.range` method
6
6
  // https://github.com/tc39/proposal-Number.range
7
7
  $({ target: 'Number', stat: true }, {
8
8
  range: function range(start, end, option) {
9
- return new RangeIterator(start, end, option, 'number', 0, 1);
9
+ return new NumericRangeIterator(start, end, option, 'number', 0, 1);
10
10
  }
11
11
  });
@@ -40,7 +40,8 @@ var subscriptionClosed = function (subscriptionState) {
40
40
  return subscriptionState.observer === undefined;
41
41
  };
42
42
 
43
- var close = function (subscription, subscriptionState) {
43
+ var close = function (subscriptionState) {
44
+ var subscription = subscriptionState.facade;
44
45
  if (!DESCRIPTORS) {
45
46
  subscription.closed = true;
46
47
  var subscriptionObserver = subscriptionState.subscriptionObserver;
@@ -79,7 +80,7 @@ Subscription.prototype = redefineAll({}, {
79
80
  unsubscribe: function unsubscribe() {
80
81
  var subscriptionState = getInternalState(this);
81
82
  if (!subscriptionClosed(subscriptionState)) {
82
- close(this, subscriptionState);
83
+ close(subscriptionState);
83
84
  cleanupSubscription(subscriptionState);
84
85
  }
85
86
  }
@@ -111,11 +112,10 @@ SubscriptionObserver.prototype = redefineAll({}, {
111
112
  }
112
113
  },
113
114
  error: function error(value) {
114
- var subscription = getInternalState(this).subscription;
115
- var subscriptionState = getInternalState(subscription);
115
+ var subscriptionState = getInternalState(getInternalState(this).subscription);
116
116
  if (!subscriptionClosed(subscriptionState)) {
117
117
  var observer = subscriptionState.observer;
118
- close(subscription, subscriptionState);
118
+ close(subscriptionState);
119
119
  try {
120
120
  var errorMethod = getMethod(observer.error);
121
121
  if (errorMethod) errorMethod.call(observer, value);
@@ -126,11 +126,10 @@ SubscriptionObserver.prototype = redefineAll({}, {
126
126
  }
127
127
  },
128
128
  complete: function complete() {
129
- var subscription = getInternalState(this).subscription;
130
- var subscriptionState = getInternalState(subscription);
129
+ var subscriptionState = getInternalState(getInternalState(this).subscription);
131
130
  if (!subscriptionClosed(subscriptionState)) {
132
131
  var observer = subscriptionState.observer;
133
- close(subscription, subscriptionState);
132
+ close(subscriptionState);
134
133
  try {
135
134
  var completeMethod = getMethod(observer.complete);
136
135
  if (completeMethod) completeMethod.call(observer);