core-js-pure 3.22.3 → 3.22.6

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 (60) hide show
  1. package/internals/async-from-sync-iterator.js +2 -2
  2. package/internals/async-iterator-create-proxy.js +2 -2
  3. package/internals/async-iterator-prototype.js +2 -2
  4. package/internals/collection-strong.js +3 -3
  5. package/internals/collection-weak.js +3 -3
  6. package/internals/define-built-in-accessor.js +5 -0
  7. package/internals/{redefine.js → define-built-in.js} +1 -0
  8. package/internals/{redefine-all.js → define-built-ins.js} +2 -2
  9. package/internals/{set-global.js → define-global-property.js} +0 -0
  10. package/internals/define-iterator.js +4 -4
  11. package/internals/export.js +14 -14
  12. package/internals/iterator-create-proxy.js +2 -2
  13. package/internals/iterators-core.js +2 -2
  14. package/internals/make-built-in.js +3 -0
  15. package/internals/math-expm1.js +2 -1
  16. package/internals/math-fround.js +3 -2
  17. package/internals/math-log1p.js +2 -1
  18. package/internals/math-sign.js +2 -1
  19. package/internals/math-trunc.js +10 -0
  20. package/internals/shared-store.js +2 -2
  21. package/internals/shared.js +2 -2
  22. package/internals/symbol-define-to-primitive.js +3 -3
  23. package/internals/to-integer-or-infinity.js +3 -4
  24. package/modules/es.aggregate-error.cause.js +1 -1
  25. package/modules/es.aggregate-error.constructor.js +1 -1
  26. package/modules/es.array.concat.js +1 -1
  27. package/modules/es.data-view.constructor.js +1 -1
  28. package/modules/es.error.cause.js +2 -2
  29. package/modules/es.function.has-instance.js +3 -2
  30. package/modules/es.json.stringify.js +1 -1
  31. package/modules/es.math.acosh.js +4 -3
  32. package/modules/es.math.asinh.js +2 -1
  33. package/modules/es.math.atanh.js +2 -1
  34. package/modules/es.math.cbrt.js +2 -1
  35. package/modules/es.math.clz32.js +2 -1
  36. package/modules/es.math.hypot.js +1 -1
  37. package/modules/es.math.sinh.js +2 -1
  38. package/modules/es.math.tanh.js +4 -3
  39. package/modules/es.math.trunc.js +2 -6
  40. package/modules/es.object.assign.js +1 -1
  41. package/modules/es.promise.catch.js +2 -2
  42. package/modules/es.promise.constructor.js +17 -21
  43. package/modules/es.promise.finally.js +2 -2
  44. package/modules/es.string.from-code-point.js +1 -1
  45. package/modules/es.string.match-all.js +2 -2
  46. package/modules/es.symbol.constructor.js +5 -5
  47. package/modules/es.weak-map.constructor.js +2 -2
  48. package/modules/esnext.array.to-spliced.js +1 -1
  49. package/modules/esnext.async-iterator.constructor.js +1 -1
  50. package/modules/esnext.iterator.constructor.js +1 -1
  51. package/modules/esnext.map.merge.js +1 -1
  52. package/modules/esnext.math.signbit.js +3 -1
  53. package/modules/esnext.observable.constructor.js +12 -12
  54. package/modules/web.dom-exception.constructor.js +10 -10
  55. package/modules/web.dom-exception.stack.js +1 -1
  56. package/modules/web.queue-microtask.js +1 -1
  57. package/modules/web.structured-clone.js +21 -9
  58. package/modules/web.url-search-params.constructor.js +8 -8
  59. package/modules/web.url.constructor.js +43 -45
  60. package/package.json +2 -3
@@ -3,7 +3,7 @@ var apply = require('../internals/function-apply');
3
3
  var anObject = require('../internals/an-object');
4
4
  var create = require('../internals/object-create');
5
5
  var getMethod = require('../internals/get-method');
6
- var redefineAll = require('../internals/redefine-all');
6
+ var defineBuiltIns = require('../internals/define-built-ins');
7
7
  var InternalStateModule = require('../internals/internal-state');
8
8
  var getBuiltIn = require('../internals/get-built-in');
9
9
  var AsyncIteratorPrototype = require('../internals/async-iterator-prototype');
@@ -29,7 +29,7 @@ var AsyncFromSyncIterator = function AsyncIterator(iterator) {
29
29
  });
30
30
  };
31
31
 
32
- AsyncFromSyncIterator.prototype = redefineAll(create(AsyncIteratorPrototype), {
32
+ AsyncFromSyncIterator.prototype = defineBuiltIns(create(AsyncIteratorPrototype), {
33
33
  next: function next(arg) {
34
34
  var state = getInternalState(this);
35
35
  var hasArg = !!arguments.length;
@@ -4,7 +4,7 @@ var aCallable = require('../internals/a-callable');
4
4
  var anObject = require('../internals/an-object');
5
5
  var create = require('../internals/object-create');
6
6
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
7
- var redefineAll = require('../internals/redefine-all');
7
+ var defineBuiltIns = require('../internals/define-built-ins');
8
8
  var wellKnownSymbol = require('../internals/well-known-symbol');
9
9
  var InternalStateModule = require('../internals/internal-state');
10
10
  var getBuiltIn = require('../internals/get-built-in');
@@ -28,7 +28,7 @@ module.exports = function (nextHandler, IS_ITERATOR) {
28
28
  setInternalState(this, state);
29
29
  };
30
30
 
31
- AsyncIteratorProxy.prototype = redefineAll(create(AsyncIteratorPrototype), {
31
+ AsyncIteratorProxy.prototype = defineBuiltIns(create(AsyncIteratorPrototype), {
32
32
  next: function next(arg) {
33
33
  var that = this;
34
34
  var hasArgument = !!arguments.length;
@@ -3,7 +3,7 @@ var shared = require('../internals/shared-store');
3
3
  var isCallable = require('../internals/is-callable');
4
4
  var create = require('../internals/object-create');
5
5
  var getPrototypeOf = require('../internals/object-get-prototype-of');
6
- var redefine = require('../internals/redefine');
6
+ var defineBuiltIn = require('../internals/define-built-in');
7
7
  var wellKnownSymbol = require('../internals/well-known-symbol');
8
8
  var IS_PURE = require('../internals/is-pure');
9
9
 
@@ -29,7 +29,7 @@ if (!AsyncIteratorPrototype) AsyncIteratorPrototype = {};
29
29
  else if (IS_PURE) AsyncIteratorPrototype = create(AsyncIteratorPrototype);
30
30
 
31
31
  if (!isCallable(AsyncIteratorPrototype[ASYNC_ITERATOR])) {
32
- redefine(AsyncIteratorPrototype, ASYNC_ITERATOR, function () {
32
+ defineBuiltIn(AsyncIteratorPrototype, ASYNC_ITERATOR, function () {
33
33
  return this;
34
34
  });
35
35
  }
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var defineProperty = require('../internals/object-define-property').f;
3
3
  var create = require('../internals/object-create');
4
- var redefineAll = require('../internals/redefine-all');
4
+ var defineBuiltIns = require('../internals/define-built-ins');
5
5
  var bind = require('../internals/function-bind-context');
6
6
  var anInstance = require('../internals/an-instance');
7
7
  var iterate = require('../internals/iterate');
@@ -71,7 +71,7 @@ module.exports = {
71
71
  }
72
72
  };
73
73
 
74
- redefineAll(Prototype, {
74
+ defineBuiltIns(Prototype, {
75
75
  // `{ Map, Set }.prototype.clear()` methods
76
76
  // https://tc39.es/ecma262/#sec-map.prototype.clear
77
77
  // https://tc39.es/ecma262/#sec-set.prototype.clear
@@ -131,7 +131,7 @@ module.exports = {
131
131
  }
132
132
  });
133
133
 
134
- redefineAll(Prototype, IS_MAP ? {
134
+ defineBuiltIns(Prototype, IS_MAP ? {
135
135
  // `Map.prototype.get(key)` method
136
136
  // https://tc39.es/ecma262/#sec-map.prototype.get
137
137
  get: function get(key) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  var uncurryThis = require('../internals/function-uncurry-this');
3
- var redefineAll = require('../internals/redefine-all');
3
+ var defineBuiltIns = require('../internals/define-built-ins');
4
4
  var getWeakData = require('../internals/internal-metadata').getWeakData;
5
5
  var anObject = require('../internals/an-object');
6
6
  var isObject = require('../internals/is-object');
@@ -78,7 +78,7 @@ module.exports = {
78
78
  return that;
79
79
  };
80
80
 
81
- redefineAll(Prototype, {
81
+ defineBuiltIns(Prototype, {
82
82
  // `{ WeakMap, WeakSet }.prototype.delete(key)` methods
83
83
  // https://tc39.es/ecma262/#sec-weakmap.prototype.delete
84
84
  // https://tc39.es/ecma262/#sec-weakset.prototype.delete
@@ -101,7 +101,7 @@ module.exports = {
101
101
  }
102
102
  });
103
103
 
104
- redefineAll(Prototype, IS_MAP ? {
104
+ defineBuiltIns(Prototype, IS_MAP ? {
105
105
  // `WeakMap.prototype.get(key)` method
106
106
  // https://tc39.es/ecma262/#sec-weakmap.prototype.get
107
107
  get: function get(key) {
@@ -0,0 +1,5 @@
1
+ var defineProperty = require('../internals/object-define-property');
2
+
3
+ module.exports = function (target, name, descriptor) {
4
+ return defineProperty.f(target, name, descriptor);
5
+ };
@@ -3,4 +3,5 @@ var createNonEnumerableProperty = require('../internals/create-non-enumerable-pr
3
3
  module.exports = function (target, key, value, options) {
4
4
  if (options && options.enumerable) target[key] = value;
5
5
  else createNonEnumerableProperty(target, key, value);
6
+ return target;
6
7
  };
@@ -1,8 +1,8 @@
1
- var redefine = require('../internals/redefine');
1
+ var defineBuiltIn = require('../internals/define-built-in');
2
2
 
3
3
  module.exports = function (target, src, options) {
4
4
  for (var key in src) {
5
5
  if (options && options.unsafe && target[key]) target[key] = src[key];
6
- else redefine(target, key, src[key], options);
6
+ else defineBuiltIn(target, key, src[key], options);
7
7
  } return target;
8
8
  };
@@ -9,7 +9,7 @@ var getPrototypeOf = require('../internals/object-get-prototype-of');
9
9
  var setPrototypeOf = require('../internals/object-set-prototype-of');
10
10
  var setToStringTag = require('../internals/set-to-string-tag');
11
11
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
12
- var redefine = require('../internals/redefine');
12
+ var defineBuiltIn = require('../internals/define-built-in');
13
13
  var wellKnownSymbol = require('../internals/well-known-symbol');
14
14
  var Iterators = require('../internals/iterators');
15
15
  var IteratorsCore = require('../internals/iterators-core');
@@ -56,7 +56,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
56
56
  if (setPrototypeOf) {
57
57
  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
58
58
  } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
59
- redefine(CurrentIteratorPrototype, ITERATOR, returnThis);
59
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
60
60
  }
61
61
  }
62
62
  // Set @@toStringTag to native iterators
@@ -84,14 +84,14 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
84
84
  };
85
85
  if (FORCED) for (KEY in methods) {
86
86
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
87
- redefine(IterablePrototype, KEY, methods[KEY]);
87
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
88
88
  }
89
89
  } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
90
90
  }
91
91
 
92
92
  // define iterator
93
93
  if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
94
- redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
94
+ defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
95
95
  }
96
96
  Iterators[NAME] = defaultIterator;
97
97
 
@@ -25,19 +25,19 @@ var wrapConstructor = function (NativeConstructor) {
25
25
  };
26
26
 
27
27
  /*
28
- options.target - name of the target object
29
- options.global - target is the global object
30
- options.stat - export as static methods of target
31
- options.proto - export as prototype methods of target
32
- options.real - real prototype method for the `pure` version
33
- options.forced - export even if the native feature is available
34
- options.bind - bind methods to the target, required for the `pure` version
35
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
36
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
37
- options.sham - add a flag to not completely full polyfills
38
- options.enumerable - export as enumerable property
39
- options.noTargetGet - prevent calling a getter on target
40
- options.name - the .name of the function if it does not match the key
28
+ options.target - name of the target object
29
+ options.global - target is the global object
30
+ options.stat - export as static methods of target
31
+ options.proto - export as prototype methods of target
32
+ options.real - real prototype method for the `pure` version
33
+ options.forced - export even if the native feature is available
34
+ options.bind - bind methods to the target, required for the `pure` version
35
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
36
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
37
+ options.sham - add a flag to not completely full polyfills
38
+ options.enumerable - export as enumerable property
39
+ options.dontCallGetSet - prevent calling a getter on target
40
+ options.name - the .name of the function if it does not match the key
41
41
  */
42
42
  module.exports = function (options, source) {
43
43
  var TARGET = options.target;
@@ -60,7 +60,7 @@ module.exports = function (options, source) {
60
60
 
61
61
  targetProperty = target[key];
62
62
 
63
- if (USE_NATIVE) if (options.noTargetGet) {
63
+ if (USE_NATIVE) if (options.dontCallGetSet) {
64
64
  descriptor = getOwnPropertyDescriptor(nativeSource, key);
65
65
  nativeProperty = descriptor && descriptor.value;
66
66
  } else nativeProperty = nativeSource[key];
@@ -4,7 +4,7 @@ var aCallable = require('../internals/a-callable');
4
4
  var anObject = require('../internals/an-object');
5
5
  var create = require('../internals/object-create');
6
6
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
7
- var redefineAll = require('../internals/redefine-all');
7
+ var defineBuiltIns = require('../internals/define-built-ins');
8
8
  var wellKnownSymbol = require('../internals/well-known-symbol');
9
9
  var InternalStateModule = require('../internals/internal-state');
10
10
  var getMethod = require('../internals/get-method');
@@ -25,7 +25,7 @@ module.exports = function (nextHandler, IS_ITERATOR) {
25
25
  setInternalState(this, state);
26
26
  };
27
27
 
28
- IteratorProxy.prototype = redefineAll(create(IteratorPrototype), {
28
+ IteratorProxy.prototype = defineBuiltIns(create(IteratorPrototype), {
29
29
  next: function next(arg) {
30
30
  var state = getInternalState(this);
31
31
  var args = arguments.length ? [state.ignoreArg ? undefined : arg] : IS_ITERATOR ? [] : [undefined];
@@ -3,7 +3,7 @@ var fails = require('../internals/fails');
3
3
  var isCallable = require('../internals/is-callable');
4
4
  var create = require('../internals/object-create');
5
5
  var getPrototypeOf = require('../internals/object-get-prototype-of');
6
- var redefine = require('../internals/redefine');
6
+ var defineBuiltIn = require('../internals/define-built-in');
7
7
  var wellKnownSymbol = require('../internals/well-known-symbol');
8
8
  var IS_PURE = require('../internals/is-pure');
9
9
 
@@ -37,7 +37,7 @@ else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
37
37
  // `%IteratorPrototype%[@@iterator]()` method
38
38
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
39
39
  if (!isCallable(IteratorPrototype[ITERATOR])) {
40
- redefine(IteratorPrototype, ITERATOR, function () {
40
+ defineBuiltIn(IteratorPrototype, ITERATOR, function () {
41
41
  return this;
42
42
  });
43
43
  }
@@ -0,0 +1,3 @@
1
+ module.exports = function (value) {
2
+ return value;
3
+ };
@@ -10,5 +10,6 @@ module.exports = (!$expm1
10
10
  // Tor Browser bug
11
11
  || $expm1(-2e-17) != -2e-17
12
12
  ) ? function expm1(x) {
13
- return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
13
+ var n = +x;
14
+ return n == 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
14
15
  } : $expm1;
@@ -15,8 +15,9 @@ var roundTiesToEven = function (n) {
15
15
  // https://tc39.es/ecma262/#sec-math.fround
16
16
  // eslint-disable-next-line es-x/no-math-fround -- safe
17
17
  module.exports = Math.fround || function fround(x) {
18
- var $abs = abs(x);
19
- var $sign = sign(x);
18
+ var n = +x;
19
+ var $abs = abs(n);
20
+ var $sign = sign(n);
20
21
  var a, result;
21
22
  if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
22
23
  a = (1 + EPSILON32 / EPSILON) * $abs;
@@ -4,5 +4,6 @@ var log = Math.log;
4
4
  // https://tc39.es/ecma262/#sec-math.log1p
5
5
  // eslint-disable-next-line es-x/no-math-log1p -- safe
6
6
  module.exports = Math.log1p || function log1p(x) {
7
- return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
7
+ var n = +x;
8
+ return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log(1 + n);
8
9
  };
@@ -2,6 +2,7 @@
2
2
  // https://tc39.es/ecma262/#sec-math.sign
3
3
  // eslint-disable-next-line es-x/no-math-sign -- safe
4
4
  module.exports = Math.sign || function sign(x) {
5
+ var n = +x;
5
6
  // eslint-disable-next-line no-self-compare -- NaN check
6
- return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
7
+ return n == 0 || n != n ? n : n < 0 ? -1 : 1;
7
8
  };
@@ -0,0 +1,10 @@
1
+ var ceil = Math.ceil;
2
+ var floor = Math.floor;
3
+
4
+ // `Math.trunc` method
5
+ // https://tc39.es/ecma262/#sec-math.trunc
6
+ // eslint-disable-next-line es-x/no-math-trunc -- safe
7
+ module.exports = Math.trunc || function trunc(x) {
8
+ var n = +x;
9
+ return (n > 0 ? floor : ceil)(n);
10
+ };
@@ -1,7 +1,7 @@
1
1
  var global = require('../internals/global');
2
- var setGlobal = require('../internals/set-global');
2
+ var defineGlobalProperty = require('../internals/define-global-property');
3
3
 
4
4
  var SHARED = '__core-js_shared__';
5
- var store = global[SHARED] || setGlobal(SHARED, {});
5
+ var store = global[SHARED] || defineGlobalProperty(SHARED, {});
6
6
 
7
7
  module.exports = store;
@@ -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.22.3',
7
+ version: '3.22.6',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
10
- license: 'https://github.com/zloirock/core-js/blob/v3.22.3/LICENSE',
10
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.6/LICENSE',
11
11
  source: 'https://github.com/zloirock/core-js'
12
12
  });
@@ -1,7 +1,7 @@
1
1
  var call = require('../internals/function-call');
2
2
  var getBuiltIn = require('../internals/get-built-in');
3
3
  var wellKnownSymbol = require('../internals/well-known-symbol');
4
- var redefine = require('../internals/redefine');
4
+ var defineBuiltIn = require('../internals/define-built-in');
5
5
 
6
6
  module.exports = function () {
7
7
  var Symbol = getBuiltIn('Symbol');
@@ -13,8 +13,8 @@ module.exports = function () {
13
13
  // `Symbol.prototype[@@toPrimitive]` method
14
14
  // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
15
15
  // eslint-disable-next-line no-unused-vars -- required for .length
16
- redefine(SymbolPrototype, TO_PRIMITIVE, function (hint) {
16
+ defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
17
17
  return call(valueOf, this);
18
- });
18
+ }, { arity: 1 });
19
19
  }
20
20
  };
@@ -1,10 +1,9 @@
1
- var ceil = Math.ceil;
2
- var floor = Math.floor;
1
+ var trunc = require('../internals/math-trunc');
3
2
 
4
3
  // `ToIntegerOrInfinity` abstract operation
5
4
  // https://tc39.es/ecma262/#sec-tointegerorinfinity
6
5
  module.exports = function (argument) {
7
6
  var number = +argument;
8
- // eslint-disable-next-line no-self-compare -- safe
9
- return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
7
+ // eslint-disable-next-line no-self-compare -- NaN check
8
+ return number !== number || number === 0 ? 0 : trunc(number);
10
9
  };
@@ -13,7 +13,7 @@ var FORCED = !fails(function () {
13
13
  });
14
14
 
15
15
  // https://github.com/tc39/proposal-error-cause
16
- $({ global: true, forced: FORCED }, {
16
+ $({ global: true, constructor: true, arity: 2, forced: FORCED }, {
17
17
  AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) {
18
18
  // eslint-disable-next-line no-unused-vars -- required for functions `.length`
19
19
  return function AggregateError(errors, message) { return apply(init, this, arguments); };
@@ -49,6 +49,6 @@ var AggregateErrorPrototype = $AggregateError.prototype = create(Error.prototype
49
49
 
50
50
  // `AggregateError` constructor
51
51
  // https://tc39.es/ecma262/#sec-aggregate-error-constructor
52
- $({ global: true }, {
52
+ $({ global: true, constructor: true, arity: 2 }, {
53
53
  AggregateError: $AggregateError
54
54
  });
@@ -39,7 +39,7 @@ var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
39
39
  // `Array.prototype.concat` method
40
40
  // https://tc39.es/ecma262/#sec-array.prototype.concat
41
41
  // with adding support of @@isConcatSpreadable and @@species
42
- $({ target: 'Array', proto: true, forced: FORCED }, {
42
+ $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
43
43
  // eslint-disable-next-line no-unused-vars -- required for `.length`
44
44
  concat: function concat(arg) {
45
45
  var O = toObject(this);
@@ -4,6 +4,6 @@ var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');
4
4
 
5
5
  // `DataView` constructor
6
6
  // https://tc39.es/ecma262/#sec-dataview-constructor
7
- $({ global: true, forced: !NATIVE_ARRAY_BUFFER }, {
7
+ $({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, {
8
8
  DataView: ArrayBufferModule.DataView
9
9
  });
@@ -12,14 +12,14 @@ var FORCED = Error('e', { cause: 7 }).cause !== 7;
12
12
  var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
13
13
  var O = {};
14
14
  O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
15
- $({ global: true, forced: FORCED }, O);
15
+ $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
16
16
  };
17
17
 
18
18
  var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
19
19
  if (WebAssembly && WebAssembly[ERROR_NAME]) {
20
20
  var O = {};
21
21
  O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
22
- $({ target: WEB_ASSEMBLY, stat: true, forced: FORCED }, O);
22
+ $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
23
23
  }
24
24
  };
25
25
 
@@ -4,6 +4,7 @@ var isObject = require('../internals/is-object');
4
4
  var definePropertyModule = require('../internals/object-define-property');
5
5
  var getPrototypeOf = require('../internals/object-get-prototype-of');
6
6
  var wellKnownSymbol = require('../internals/well-known-symbol');
7
+ var makeBuiltIn = require('../internals/make-built-in');
7
8
 
8
9
  var HAS_INSTANCE = wellKnownSymbol('hasInstance');
9
10
  var FunctionPrototype = Function.prototype;
@@ -11,12 +12,12 @@ var FunctionPrototype = Function.prototype;
11
12
  // `Function.prototype[@@hasInstance]` method
12
13
  // https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance
13
14
  if (!(HAS_INSTANCE in FunctionPrototype)) {
14
- definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: function (O) {
15
+ definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function (O) {
15
16
  if (!isCallable(this) || !isObject(O)) return false;
16
17
  var P = this.prototype;
17
18
  if (!isObject(P)) return O instanceof this;
18
19
  // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
19
20
  while (O = getPrototypeOf(O)) if (P === O) return true;
20
21
  return false;
21
- } });
22
+ }, HAS_INSTANCE) });
22
23
  }
@@ -61,7 +61,7 @@ var fixIllFormed = function (match, offset, string) {
61
61
  if ($stringify) {
62
62
  // `JSON.stringify` method
63
63
  // https://tc39.es/ecma262/#sec-json.stringify
64
- $({ target: 'JSON', stat: true, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
64
+ $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
65
65
  // eslint-disable-next-line no-unused-vars -- required for `.length`
66
66
  stringify: function stringify(it, replacer, space) {
67
67
  var args = arraySlice(arguments);
@@ -17,8 +17,9 @@ var FORCED = !$acosh
17
17
  // https://tc39.es/ecma262/#sec-math.acosh
18
18
  $({ target: 'Math', stat: true, forced: FORCED }, {
19
19
  acosh: function acosh(x) {
20
- return (x = +x) < 1 ? NaN : x > 94906265.62425156
21
- ? log(x) + LN2
22
- : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
20
+ var n = +x;
21
+ return n < 1 ? NaN : n > 94906265.62425156
22
+ ? log(n) + LN2
23
+ : log1p(n - 1 + sqrt(n - 1) * sqrt(n + 1));
23
24
  }
24
25
  });
@@ -6,7 +6,8 @@ var log = Math.log;
6
6
  var sqrt = Math.sqrt;
7
7
 
8
8
  function asinh(x) {
9
- return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1));
9
+ var n = +x;
10
+ return !isFinite(n) || n == 0 ? n : n < 0 ? -asinh(-n) : log(n + sqrt(n * n + 1));
10
11
  }
11
12
 
12
13
  // `Math.asinh` method
@@ -9,6 +9,7 @@ var log = Math.log;
9
9
  // Tor Browser bug: Math.atanh(-0) -> 0
10
10
  $({ target: 'Math', stat: true, forced: !($atanh && 1 / $atanh(-0) < 0) }, {
11
11
  atanh: function atanh(x) {
12
- return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2;
12
+ var n = +x;
13
+ return n == 0 ? n : log((1 + n) / (1 - n)) / 2;
13
14
  }
14
15
  });
@@ -8,6 +8,7 @@ var pow = Math.pow;
8
8
  // https://tc39.es/ecma262/#sec-math.cbrt
9
9
  $({ target: 'Math', stat: true }, {
10
10
  cbrt: function cbrt(x) {
11
- return sign(x = +x) * pow(abs(x), 1 / 3);
11
+ var n = +x;
12
+ return sign(n) * pow(abs(n), 1 / 3);
12
13
  }
13
14
  });
@@ -8,6 +8,7 @@ var LOG2E = Math.LOG2E;
8
8
  // https://tc39.es/ecma262/#sec-math.clz32
9
9
  $({ target: 'Math', stat: true }, {
10
10
  clz32: function clz32(x) {
11
- return (x >>>= 0) ? 31 - floor(log(x + 0.5) * LOG2E) : 32;
11
+ var n = x >>> 0;
12
+ return n ? 31 - floor(log(n + 0.5) * LOG2E) : 32;
12
13
  }
13
14
  });
@@ -11,7 +11,7 @@ var BUGGY = !!$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, forced: BUGGY }, {
14
+ $({ target: 'Math', stat: true, arity: 2, forced: BUGGY }, {
15
15
  // eslint-disable-next-line no-unused-vars -- required for `.length`
16
16
  hypot: function hypot(value1, value2) {
17
17
  var sum = 0;
@@ -16,6 +16,7 @@ var FORCED = fails(function () {
16
16
  // V8 near Chromium 38 has a problem with very small numbers
17
17
  $({ target: 'Math', stat: true, forced: FORCED }, {
18
18
  sinh: function sinh(x) {
19
- return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2);
19
+ var n = +x;
20
+ return abs(n) < 1 ? (expm1(n) - expm1(-n)) / 2 : (exp(n - 1) - exp(-n - 1)) * (E / 2);
20
21
  }
21
22
  });
@@ -7,8 +7,9 @@ var exp = Math.exp;
7
7
  // https://tc39.es/ecma262/#sec-math.tanh
8
8
  $({ target: 'Math', stat: true }, {
9
9
  tanh: function tanh(x) {
10
- var a = expm1(x = +x);
11
- var b = expm1(-x);
12
- return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
10
+ var n = +x;
11
+ var a = expm1(n);
12
+ var b = expm1(-n);
13
+ return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(n) + exp(-n));
13
14
  }
14
15
  });
@@ -1,12 +1,8 @@
1
1
  var $ = require('../internals/export');
2
-
3
- var ceil = Math.ceil;
4
- var floor = Math.floor;
2
+ var trunc = require('../internals/math-trunc');
5
3
 
6
4
  // `Math.trunc` method
7
5
  // https://tc39.es/ecma262/#sec-math.trunc
8
6
  $({ target: 'Math', stat: true }, {
9
- trunc: function trunc(it) {
10
- return (it > 0 ? floor : ceil)(it);
11
- }
7
+ trunc: trunc
12
8
  });
@@ -4,6 +4,6 @@ var assign = require('../internals/object-assign');
4
4
  // `Object.assign` method
5
5
  // https://tc39.es/ecma262/#sec-object.assign
6
6
  // eslint-disable-next-line es-x/no-object-assign -- required for testing
7
- $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
7
+ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
8
8
  assign: assign
9
9
  });
@@ -5,7 +5,7 @@ var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detec
5
5
  var NativePromiseConstructor = require('../internals/promise-native-constructor');
6
6
  var getBuiltIn = require('../internals/get-built-in');
7
7
  var isCallable = require('../internals/is-callable');
8
- var redefine = require('../internals/redefine');
8
+ var defineBuiltIn = require('../internals/define-built-in');
9
9
 
10
10
  var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
11
11
 
@@ -21,6 +21,6 @@ $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: tr
21
21
  if (!IS_PURE && isCallable(NativePromiseConstructor)) {
22
22
  var method = getBuiltIn('Promise').prototype['catch'];
23
23
  if (NativePromisePrototype['catch'] !== method) {
24
- redefine(NativePromisePrototype, 'catch', method, { unsafe: true });
24
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
25
25
  }
26
26
  }