core-js-pure 3.6.3 → 3.6.4

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.
@@ -9,7 +9,8 @@ var min = Math.min;
9
9
  var nativeLastIndexOf = [].lastIndexOf;
10
10
  var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
11
11
  var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
12
- var USES_TO_LENGTH = arrayMethodUsesToLength('lastIndexOf', { ACCESSORS: true, 1: 2147483647 });
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 });
13
14
  var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
14
15
 
15
16
  // `Array.prototype.lastIndexOf` method implementation
@@ -3,28 +3,25 @@ var fails = require('../internals/fails');
3
3
  var has = require('../internals/has');
4
4
 
5
5
  var defineProperty = Object.defineProperty;
6
+ var cache = {};
6
7
 
7
8
  var thrower = function (it) { throw it; };
8
9
 
9
10
  module.exports = function (METHOD_NAME, options) {
11
+ if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
10
12
  if (!options) options = {};
11
13
  var method = [][METHOD_NAME];
12
14
  var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
13
15
  var argument0 = has(options, 0) ? options[0] : thrower;
14
16
  var argument1 = has(options, 1) ? options[1] : undefined;
15
17
 
16
- return !!method && !fails(function () {
18
+ return cache[METHOD_NAME] = !!method && !fails(function () {
17
19
  if (ACCESSORS && !DESCRIPTORS) return true;
18
20
  var O = { length: -1 };
19
21
 
20
- var addTrap = function (key) {
21
- if (ACCESSORS) defineProperty(O, key, { enumerable: true, get: thrower });
22
- else O[key] = 1;
23
- };
22
+ if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
23
+ else O[1] = 1;
24
24
 
25
- addTrap(1);
26
- addTrap(2147483646);
27
- addTrap(4294967294);
28
25
  method.call(O, argument0, argument1);
29
26
  });
30
27
  };
@@ -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.6.3',
7
+ version: '3.6.4',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -5,7 +5,8 @@ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5
5
  var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
6
6
 
7
7
  var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
8
- var USES_TO_LENGTH = arrayMethodUsesToLength('reduceRight', { 1: 0 });
8
+ // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
9
+ var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
9
10
 
10
11
  // `Array.prototype.reduceRight` method
11
12
  // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
3
  "description": "Standard library",
4
- "version": "3.6.3",
4
+ "version": "3.6.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"