core-js-pure 3.20.2 → 3.20.3

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.
@@ -1,9 +1,10 @@
1
+ var NATIVE_BIND = require('../internals/function-bind-native');
2
+
1
3
  var FunctionPrototype = Function.prototype;
2
4
  var apply = FunctionPrototype.apply;
3
- var bind = FunctionPrototype.bind;
4
5
  var call = FunctionPrototype.call;
5
6
 
6
7
  // eslint-disable-next-line es/no-reflect -- safe
7
- module.exports = typeof Reflect == 'object' && Reflect.apply || (bind ? call.bind(apply) : function () {
8
+ module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
8
9
  return call.apply(apply, arguments);
9
10
  });
@@ -1,12 +1,13 @@
1
1
  var uncurryThis = require('../internals/function-uncurry-this');
2
2
  var aCallable = require('../internals/a-callable');
3
+ var NATIVE_BIND = require('../internals/function-bind-native');
3
4
 
4
5
  var bind = uncurryThis(uncurryThis.bind);
5
6
 
6
7
  // optional / simple context binding
7
8
  module.exports = function (fn, that) {
8
9
  aCallable(fn);
9
- return that === undefined ? fn : bind ? bind(fn, that) : function (/* ...args */) {
10
+ return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
10
11
  return fn.apply(that, arguments);
11
12
  };
12
13
  };
@@ -0,0 +1,7 @@
1
+ var fails = require('../internals/fails');
2
+
3
+ module.exports = !fails(function () {
4
+ var test = (function () { /* empty */ }).bind();
5
+ // eslint-disable-next-line no-prototype-builtins -- safe
6
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
7
+ });
@@ -5,6 +5,7 @@ var aCallable = require('../internals/a-callable');
5
5
  var isObject = require('../internals/is-object');
6
6
  var hasOwn = require('../internals/has-own-property');
7
7
  var arraySlice = require('../internals/array-slice');
8
+ var NATIVE_BIND = require('../internals/function-bind-native');
8
9
 
9
10
  var Function = global.Function;
10
11
  var concat = uncurryThis([].concat);
@@ -20,7 +21,7 @@ var construct = function (C, argsLength, args) {
20
21
 
21
22
  // `Function.prototype.bind` method implementation
22
23
  // https://tc39.es/ecma262/#sec-function.prototype.bind
23
- module.exports = Function.bind || function bind(that /* , ...args */) {
24
+ module.exports = NATIVE_BIND ? Function.bind : function bind(that /* , ...args */) {
24
25
  var F = aCallable(this);
25
26
  var Prototype = F.prototype;
26
27
  var partArgs = arraySlice(arguments, 1);
@@ -1,5 +1,7 @@
1
+ var NATIVE_BIND = require('../internals/function-bind-native');
2
+
1
3
  var call = Function.prototype.call;
2
4
 
3
- module.exports = call.bind ? call.bind(call) : function () {
5
+ module.exports = NATIVE_BIND ? call.bind(call) : function () {
4
6
  return call.apply(call, arguments);
5
7
  };
@@ -1,9 +1,11 @@
1
+ var NATIVE_BIND = require('../internals/function-bind-native');
2
+
1
3
  var FunctionPrototype = Function.prototype;
2
4
  var bind = FunctionPrototype.bind;
3
5
  var call = FunctionPrototype.call;
4
- var uncurryThis = bind && bind.bind(call, call);
6
+ var uncurryThis = NATIVE_BIND && bind.bind(call, call);
5
7
 
6
- module.exports = bind ? function (fn) {
8
+ module.exports = NATIVE_BIND ? function (fn) {
7
9
  return fn && uncurryThis(fn);
8
10
  } : function (fn) {
9
11
  return fn && function () {
@@ -2,7 +2,7 @@ var DESCRIPTORS = require('../internals/descriptors');
2
2
  var fails = require('../internals/fails');
3
3
  var createElement = require('../internals/document-create-element');
4
4
 
5
- // Thank's IE8 for his funny defineProperty
5
+ // Thanks to IE8 for its funny defineProperty
6
6
  module.exports = !DESCRIPTORS && !fails(function () {
7
7
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
8
8
  return Object.defineProperty(createElement('div'), 'a', {
@@ -4,7 +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.20.2',
7
+ version: '3.20.3',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
- copyright: '© 2022 Denis Pushkarev (zloirock.ru)'
9
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
10
+ license: 'https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE',
11
+ source: 'https://github.com/zloirock/core-js'
10
12
  });
@@ -0,0 +1,8 @@
1
+ var global = require('../internals/global');
2
+
3
+ var TypeError = global.TypeError;
4
+
5
+ module.exports = function (passed, required) {
6
+ if (passed < required) throw TypeError('Not enough arguments');
7
+ return passed;
8
+ };
@@ -3,6 +3,6 @@ var bind = require('../internals/function-bind');
3
3
 
4
4
  // `Function.prototype.bind` method
5
5
  // https://tc39.es/ecma262/#sec-function.prototype.bind
6
- $({ target: 'Function', proto: true }, {
6
+ $({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
7
7
  bind: bind
8
8
  });
@@ -16,6 +16,7 @@ var hasOwn = require('../internals/has-own-property');
16
16
  var createProperty = require('../internals/create-property');
17
17
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
18
18
  var lengthOfArrayLike = require('../internals/length-of-array-like');
19
+ var validateArgumentsLength = require('../internals/validate-arguments-length');
19
20
  var regExpFlags = require('../internals/regexp-flags');
20
21
  var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');
21
22
 
@@ -447,7 +448,7 @@ var tryToTransfer = function (rawTransfer, map) {
447
448
 
448
449
  $({ global: true, enumerable: true, sham: !PROPER_TRANSFER, forced: FORCED_REPLACEMENT }, {
449
450
  structuredClone: function structuredClone(value /* , { transfer } */) {
450
- var options = arguments.length > 1 ? anObject(arguments[1]) : undefined;
451
+ var options = validateArgumentsLength(arguments.length, 1) > 1 ? anObject(arguments[1]) : undefined;
451
452
  var transfer = options ? options.transfer : undefined;
452
453
  var map;
453
454
 
@@ -24,6 +24,7 @@ var create = require('../internals/object-create');
24
24
  var createPropertyDescriptor = require('../internals/create-property-descriptor');
25
25
  var getIterator = require('../internals/get-iterator');
26
26
  var getIteratorMethod = require('../internals/get-iterator-method');
27
+ var validateArgumentsLength = require('../internals/validate-arguments-length');
27
28
  var wellKnownSymbol = require('../internals/well-known-symbol');
28
29
  var arraySort = require('../internals/array-sort');
29
30
 
@@ -99,10 +100,6 @@ var serialize = function (it) {
99
100
  return replace(encodeURIComponent(it), find, replacer);
100
101
  };
101
102
 
102
- var validateArgumentsLength = function (passed, required) {
103
- if (passed < required) throw TypeError('Not enough arguments');
104
- };
105
-
106
103
  var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
107
104
  setInternalState(this, {
108
105
  type: URL_SEARCH_PARAMS_ITERATOR,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
3
  "description": "Standard library",
4
- "version": "3.20.2",
4
+ "version": "3.20.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
@@ -54,5 +54,5 @@
54
54
  "scripts": {
55
55
  "postinstall": "node -e \"try{require('./postinstall')}catch(e){}\""
56
56
  },
57
- "gitHead": "da1bf15799afc93d4985392a5d1ce5468db1bdd8"
57
+ "gitHead": "4bcdaf8646f4e60bab9ac182b06803ebd230568c"
58
58
  }