core-js-pure 3.3.4 → 3.3.5

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.
@@ -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.3.4',
7
+ version: '3.3.5',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -9,12 +9,16 @@ var createProperty = require('../internals/create-property');
9
9
  var arraySpeciesCreate = require('../internals/array-species-create');
10
10
  var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
11
11
  var wellKnownSymbol = require('../internals/well-known-symbol');
12
+ var V8_VERSION = require('../internals/v8-version');
12
13
 
13
14
  var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
14
15
  var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
15
16
  var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
16
17
 
17
- var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () {
18
+ // We can't use this feature detection in V8 since it causes
19
+ // deoptimization and serious performance degradation
20
+ // https://github.com/zloirock/core-js/issues/679
21
+ var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
18
22
  var array = [];
19
23
  array[IS_CONCAT_SPREADABLE] = false;
20
24
  return array.concat()[0] !== array;
@@ -11,6 +11,7 @@ var test = [1, 2];
11
11
  // https://bugs.webkit.org/show_bug.cgi?id=188794
12
12
  $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
13
13
  reverse: function reverse() {
14
+ // eslint-disable-next-line no-self-assign
14
15
  if (isArray(this)) this.length = this.length;
15
16
  return nativeReverse.call(this);
16
17
  }
@@ -50,20 +50,26 @@ var UNHANDLED = 2;
50
50
  var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
51
51
 
52
52
  var FORCED = isForced(PROMISE, function () {
53
- // correct subclassing with @@species support
53
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
54
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
55
+ // We can't detect it synchronously, so just check versions
56
+ if (V8_VERSION === 66) return true;
57
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
58
+ if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;
59
+ // We need Promise#finally in the pure version for preventing prototype pollution
60
+ if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
61
+ // We can't use @@species feature detection in V8 since it causes
62
+ // deoptimization and performance degradation
63
+ // https://github.com/zloirock/core-js/issues/679
64
+ if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
65
+ // Detect correctness of subclassing with @@species support
54
66
  var promise = PromiseConstructor.resolve(1);
55
- var empty = function () { /* empty */ };
56
- var FakePromise = (promise.constructor = {})[SPECIES] = function (exec) {
57
- exec(empty, empty);
67
+ var FakePromise = function (exec) {
68
+ exec(function () { /* empty */ }, function () { /* empty */ });
58
69
  };
59
- // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
60
- return !((IS_NODE || typeof PromiseRejectionEvent == 'function')
61
- && (!IS_PURE || promise['finally'])
62
- && promise.then(empty) instanceof FakePromise
63
- // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
64
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
65
- // we can't detect it synchronously, so just check versions
66
- && V8_VERSION !== 66);
70
+ var constructor = promise.constructor = {};
71
+ constructor[SPECIES] = FakePromise;
72
+ return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
67
73
  });
68
74
 
69
75
  var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
@@ -20,6 +20,10 @@ if (!has(AsyncIteratorPrototype, TO_STRING_TAG)) {
20
20
  createNonEnumerableProperty(AsyncIteratorPrototype, TO_STRING_TAG, 'AsyncIterator');
21
21
  }
22
22
 
23
+ if (!has(AsyncIteratorPrototype, 'constructor') || AsyncIteratorPrototype.constructor === Object) {
24
+ createNonEnumerableProperty(AsyncIteratorPrototype, 'constructor', AsyncIteratorConstructor);
25
+ }
26
+
23
27
  $({ global: true, forced: IS_PURE }, {
24
28
  AsyncIterator: AsyncIteratorConstructor
25
29
  });
@@ -32,6 +32,10 @@ if (!has(IteratorPrototype, TO_STRING_TAG)) {
32
32
  createNonEnumerableProperty(IteratorPrototype, TO_STRING_TAG, 'Iterator');
33
33
  }
34
34
 
35
+ if (!has(IteratorPrototype, 'constructor') || IteratorPrototype.constructor === Object) {
36
+ createNonEnumerableProperty(IteratorPrototype, 'constructor', IteratorConstructor);
37
+ }
38
+
35
39
  IteratorConstructor.prototype = IteratorPrototype;
36
40
 
37
41
  $({ global: true, forced: FORCED }, {
@@ -33,7 +33,7 @@ $({ target: 'String', proto: true }, {
33
33
  }
34
34
  string = String(O);
35
35
  searchString = String(searchValue);
36
- if (searchString === '') return replaceAll.call(O, /(?:)/g, replaceValue);
36
+ if (searchString === '') return replaceAll.call(string, /(?:)/g, replaceValue);
37
37
  template = string.split(searchString);
38
38
  if (typeof replaceValue !== 'function') {
39
39
  return template.join(String(replaceValue));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
3
  "description": "Standard library",
4
- "version": "3.3.4",
4
+ "version": "3.3.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
@@ -18,6 +18,7 @@
18
18
  "ES2017",
19
19
  "ES2018",
20
20
  "ES2019",
21
+ "ES2020",
21
22
  "ECMAScript 3",
22
23
  "ECMAScript 5",
23
24
  "ECMAScript 6",
@@ -27,6 +28,7 @@
27
28
  "ECMAScript 2017",
28
29
  "ECMAScript 2018",
29
30
  "ECMAScript 2019",
31
+ "ECMAScript 2020",
30
32
  "Harmony",
31
33
  "Strawman",
32
34
  "Map",