core-js 3.4.8 → 3.6.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 (169) hide show
  1. package/LICENSE +1 -1
  2. package/es/index.js +2 -0
  3. package/es/regexp/index.js +2 -0
  4. package/es/regexp/sticky.js +5 -0
  5. package/es/regexp/test.js +6 -0
  6. package/es/string/index.js +1 -0
  7. package/es/string/match.js +1 -0
  8. package/es/string/replace.js +1 -0
  9. package/es/string/search.js +1 -0
  10. package/es/string/split.js +1 -0
  11. package/es/symbol/async-iterator.js +1 -1
  12. package/es/symbol/has-instance.js +1 -1
  13. package/es/symbol/is-concat-spreadable.js +1 -1
  14. package/es/symbol/iterator.js +1 -1
  15. package/es/symbol/match-all.js +1 -1
  16. package/es/symbol/match.js +1 -1
  17. package/es/symbol/replace.js +1 -1
  18. package/es/symbol/search.js +1 -1
  19. package/es/symbol/species.js +1 -1
  20. package/es/symbol/split.js +1 -1
  21. package/es/symbol/to-primitive.js +1 -1
  22. package/es/symbol/to-string-tag.js +1 -1
  23. package/es/symbol/unscopables.js +1 -1
  24. package/features/instance/match-all.js +3 -0
  25. package/features/object/index.js +3 -0
  26. package/features/object/iterate-entries.js +4 -0
  27. package/features/object/iterate-keys.js +4 -0
  28. package/features/object/iterate-values.js +4 -0
  29. package/features/regexp/sticky.js +3 -0
  30. package/features/regexp/test.js +3 -0
  31. package/features/symbol/async-dispose.js +1 -1
  32. package/features/symbol/dispose.js +1 -1
  33. package/features/symbol/observable.js +1 -1
  34. package/features/symbol/pattern-match.js +1 -1
  35. package/features/symbol/replace-all.js +1 -1
  36. package/internals/add-to-unscopables.js +5 -2
  37. package/internals/array-buffer-native.js +1 -0
  38. package/internals/array-buffer-view-core.js +1 -9
  39. package/internals/array-buffer.js +13 -3
  40. package/internals/array-for-each.js +6 -2
  41. package/internals/array-from.js +7 -8
  42. package/internals/array-iteration.js +1 -1
  43. package/internals/array-last-index-of.js +6 -3
  44. package/internals/array-method-has-species-support.js +1 -1
  45. package/internals/{sloppy-array-method.js → array-method-is-strict.js} +1 -1
  46. package/internals/array-method-uses-to-length.js +30 -0
  47. package/internals/{create-async-iterator-proxy.js → async-iterator-create-proxy.js} +0 -0
  48. package/internals/collection-from.js +1 -1
  49. package/internals/collection-strong.js +1 -1
  50. package/internals/define-well-known-symbol.js +1 -1
  51. package/internals/descriptors.js +1 -1
  52. package/internals/{is-ios.js → engine-is-ios.js} +1 -1
  53. package/internals/{user-agent.js → engine-user-agent.js} +0 -0
  54. package/internals/{v8-version.js → engine-v8-version.js} +1 -1
  55. package/internals/entry-unbind.js +1 -1
  56. package/internals/fix-regexp-well-known-symbol-logic.js +13 -4
  57. package/internals/flatten-into-array.js +1 -1
  58. package/internals/{bind-context.js → function-bind-context.js} +0 -0
  59. package/internals/iterate.js +1 -1
  60. package/internals/{create-iterator-proxy.js → iterator-create-proxy.js} +0 -0
  61. package/internals/microtask.js +1 -1
  62. package/internals/{parse-float.js → number-parse-float.js} +4 -4
  63. package/internals/{parse-int.js → number-parse-int.js} +4 -4
  64. package/internals/object-create.js +48 -19
  65. package/internals/object-iterator.js +37 -0
  66. package/internals/{forced-object-prototype-accessors-methods.js → object-prototype-accessors-forced.js} +0 -0
  67. package/internals/regexp-exec.js +37 -4
  68. package/internals/regexp-sticky-helpers.js +23 -0
  69. package/internals/shared.js +2 -2
  70. package/internals/{forced-string-html-method.js → string-html-forced.js} +0 -0
  71. package/internals/{webkit-string-pad-bug.js → string-pad-webkit-bug.js} +1 -1
  72. package/internals/{punycode-to-ascii.js → string-punycode-to-ascii.js} +0 -0
  73. package/internals/{forced-string-trim-method.js → string-trim-forced.js} +0 -0
  74. package/internals/task.js +2 -2
  75. package/internals/typed-array-constructor.js +1 -1
  76. package/internals/{typed-arrays-constructors-requires-wrappers.js → typed-array-constructors-require-wrappers.js} +0 -0
  77. package/internals/typed-array-from.js +1 -1
  78. package/internals/use-symbol-as-uid.js +1 -1
  79. package/internals/{wrapped-well-known-symbol.js → well-known-symbol-wrapped.js} +0 -0
  80. package/internals/well-known-symbol.js +1 -1
  81. package/modules/es.array.concat.js +1 -1
  82. package/modules/es.array.every.js +6 -2
  83. package/modules/es.array.filter.js +2 -4
  84. package/modules/es.array.find-index.js +4 -1
  85. package/modules/es.array.find.js +4 -1
  86. package/modules/es.array.includes.js +4 -1
  87. package/modules/es.array.index-of.js +5 -3
  88. package/modules/es.array.join.js +3 -3
  89. package/modules/es.array.map.js +2 -4
  90. package/modules/es.array.reduce-right.js +6 -2
  91. package/modules/es.array.reduce.js +6 -2
  92. package/modules/es.array.slice.js +6 -2
  93. package/modules/es.array.some.js +6 -2
  94. package/modules/es.array.sort.js +3 -3
  95. package/modules/es.array.splice.js +5 -1
  96. package/modules/es.data-view.js +1 -1
  97. package/modules/es.number.parse-float.js +1 -1
  98. package/modules/es.number.parse-int.js +1 -1
  99. package/modules/es.object.define-getter.js +1 -1
  100. package/modules/es.object.define-setter.js +1 -1
  101. package/modules/es.object.lookup-getter.js +1 -1
  102. package/modules/es.object.lookup-setter.js +1 -1
  103. package/modules/es.parse-float.js +1 -1
  104. package/modules/es.parse-int.js +1 -1
  105. package/modules/es.promise.js +1 -1
  106. package/modules/es.regexp.constructor.js +32 -8
  107. package/modules/es.regexp.flags.js +2 -1
  108. package/modules/es.regexp.sticky.js +21 -0
  109. package/modules/es.regexp.test.js +30 -0
  110. package/modules/es.string.anchor.js +1 -1
  111. package/modules/es.string.big.js +1 -1
  112. package/modules/es.string.blink.js +1 -1
  113. package/modules/es.string.bold.js +1 -1
  114. package/modules/es.string.fixed.js +1 -1
  115. package/modules/es.string.fontcolor.js +1 -1
  116. package/modules/es.string.fontsize.js +1 -1
  117. package/modules/es.string.italics.js +1 -1
  118. package/modules/es.string.link.js +1 -1
  119. package/modules/es.string.pad-end.js +1 -1
  120. package/modules/es.string.pad-start.js +1 -1
  121. package/modules/es.string.replace.js +5 -3
  122. package/modules/es.string.small.js +1 -1
  123. package/modules/es.string.strike.js +1 -1
  124. package/modules/es.string.sub.js +1 -1
  125. package/modules/es.string.sup.js +1 -1
  126. package/modules/es.string.trim-end.js +1 -1
  127. package/modules/es.string.trim-start.js +1 -1
  128. package/modules/es.string.trim.js +1 -1
  129. package/modules/es.symbol.js +10 -8
  130. package/modules/es.typed-array.from.js +1 -1
  131. package/modules/es.typed-array.of.js +1 -1
  132. package/modules/esnext.async-iterator.as-indexed-pairs.js +1 -1
  133. package/modules/esnext.async-iterator.drop.js +1 -1
  134. package/modules/esnext.async-iterator.filter.js +1 -1
  135. package/modules/esnext.async-iterator.flat-map.js +1 -1
  136. package/modules/esnext.async-iterator.from.js +1 -1
  137. package/modules/esnext.async-iterator.map.js +1 -1
  138. package/modules/esnext.async-iterator.take.js +1 -1
  139. package/modules/esnext.iterator.as-indexed-pairs.js +1 -1
  140. package/modules/esnext.iterator.drop.js +1 -1
  141. package/modules/esnext.iterator.filter.js +1 -1
  142. package/modules/esnext.iterator.flat-map.js +1 -1
  143. package/modules/esnext.iterator.from.js +1 -1
  144. package/modules/esnext.iterator.map.js +1 -1
  145. package/modules/esnext.iterator.take.js +1 -1
  146. package/modules/esnext.map.every.js +1 -1
  147. package/modules/esnext.map.filter.js +1 -1
  148. package/modules/esnext.map.find-key.js +1 -1
  149. package/modules/esnext.map.find.js +1 -1
  150. package/modules/esnext.map.map-keys.js +1 -1
  151. package/modules/esnext.map.map-values.js +1 -1
  152. package/modules/esnext.map.some.js +1 -1
  153. package/modules/esnext.number.from-string.js +1 -1
  154. package/modules/esnext.object.iterate-entries.js +11 -0
  155. package/modules/esnext.object.iterate-keys.js +11 -0
  156. package/modules/esnext.object.iterate-values.js +11 -0
  157. package/modules/esnext.set.every.js +1 -1
  158. package/modules/esnext.set.filter.js +1 -1
  159. package/modules/esnext.set.find.js +1 -1
  160. package/modules/esnext.set.map.js +1 -1
  161. package/modules/esnext.set.some.js +1 -1
  162. package/modules/web.timers.js +1 -1
  163. package/modules/web.url-search-params.js +1 -1
  164. package/modules/web.url.js +1 -1
  165. package/package.json +1 -1
  166. package/proposals/object-iteration.js +3 -0
  167. package/stable/regexp/sticky.js +3 -0
  168. package/stable/regexp/test.js +3 -0
  169. package/stage/1.js +1 -0
@@ -1,9 +1,11 @@
1
1
  'use strict';
2
- var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
2
+ // TODO: Remove from `core-js@4` since it's moved to entry points
3
+ require('../modules/es.regexp.exec');
3
4
  var redefine = require('../internals/redefine');
4
5
  var fails = require('../internals/fails');
5
6
  var wellKnownSymbol = require('../internals/well-known-symbol');
6
7
  var regexpExec = require('../internals/regexp-exec');
8
+ var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
7
9
 
8
10
  var SPECIES = wellKnownSymbol('species');
9
11
 
@@ -20,6 +22,12 @@ var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
20
22
  return ''.replace(re, '$<a>') !== '7';
21
23
  });
22
24
 
25
+ // IE <= 11 replaces $0 with the whole match, as if it was $&
26
+ // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
27
+ var REPLACE_KEEPS_$0 = (function () {
28
+ return 'a'.replace(/./, '$0') === '$0';
29
+ })();
30
+
23
31
  // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
24
32
  // Weex JS has frozen built-in prototypes, so use try / catch wrapper
25
33
  var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
@@ -67,7 +75,7 @@ module.exports = function (KEY, length, exec, sham) {
67
75
  if (
68
76
  !DELEGATES_TO_SYMBOL ||
69
77
  !DELEGATES_TO_EXEC ||
70
- (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
78
+ (KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
71
79
  (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
72
80
  ) {
73
81
  var nativeRegExpMethod = /./[SYMBOL];
@@ -82,7 +90,7 @@ module.exports = function (KEY, length, exec, sham) {
82
90
  return { done: true, value: nativeMethod.call(str, regexp, arg2) };
83
91
  }
84
92
  return { done: false };
85
- });
93
+ }, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
86
94
  var stringMethod = methods[0];
87
95
  var regexMethod = methods[1];
88
96
 
@@ -95,6 +103,7 @@ module.exports = function (KEY, length, exec, sham) {
95
103
  // 21.2.5.9 RegExp.prototype[@@search](string)
96
104
  : function (string) { return regexMethod.call(string, this); }
97
105
  );
98
- if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
99
106
  }
107
+
108
+ if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
100
109
  };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var isArray = require('../internals/is-array');
3
3
  var toLength = require('../internals/to-length');
4
- var bind = require('../internals/bind-context');
4
+ var bind = require('../internals/function-bind-context');
5
5
 
6
6
  // `FlattenIntoArray` abstract operation
7
7
  // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
@@ -1,7 +1,7 @@
1
1
  var anObject = require('../internals/an-object');
2
2
  var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
3
3
  var toLength = require('../internals/to-length');
4
- var bind = require('../internals/bind-context');
4
+ var bind = require('../internals/function-bind-context');
5
5
  var getIteratorMethod = require('../internals/get-iterator-method');
6
6
  var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
7
7
 
@@ -2,7 +2,7 @@ var global = require('../internals/global');
2
2
  var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
3
3
  var classof = require('../internals/classof-raw');
4
4
  var macrotask = require('../internals/task').set;
5
- var IS_IOS = require('../internals/is-ios');
5
+ var IS_IOS = require('../internals/engine-is-ios');
6
6
 
7
7
  var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
8
8
  var process = global.process;
@@ -2,13 +2,13 @@ var global = require('../internals/global');
2
2
  var trim = require('../internals/string-trim').trim;
3
3
  var whitespaces = require('../internals/whitespaces');
4
4
 
5
- var nativeParseFloat = global.parseFloat;
6
- var FORCED = 1 / nativeParseFloat(whitespaces + '-0') !== -Infinity;
5
+ var $parseFloat = global.parseFloat;
6
+ var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
7
7
 
8
8
  // `parseFloat` method
9
9
  // https://tc39.github.io/ecma262/#sec-parsefloat-string
10
10
  module.exports = FORCED ? function parseFloat(string) {
11
11
  var trimmedString = trim(String(string));
12
- var result = nativeParseFloat(trimmedString);
12
+ var result = $parseFloat(trimmedString);
13
13
  return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
14
- } : nativeParseFloat;
14
+ } : $parseFloat;
@@ -2,13 +2,13 @@ var global = require('../internals/global');
2
2
  var trim = require('../internals/string-trim').trim;
3
3
  var whitespaces = require('../internals/whitespaces');
4
4
 
5
- var nativeParseInt = global.parseInt;
5
+ var $parseInt = global.parseInt;
6
6
  var hex = /^[+-]?0[Xx]/;
7
- var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
7
+ var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
8
8
 
9
9
  // `parseInt` method
10
10
  // https://tc39.github.io/ecma262/#sec-parseint-string-radix
11
11
  module.exports = FORCED ? function parseInt(string, radix) {
12
12
  var S = trim(String(string));
13
- return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
14
- } : nativeParseInt;
13
+ return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
14
+ } : $parseInt;
@@ -5,45 +5,74 @@ var hiddenKeys = require('../internals/hidden-keys');
5
5
  var html = require('../internals/html');
6
6
  var documentCreateElement = require('../internals/document-create-element');
7
7
  var sharedKey = require('../internals/shared-key');
8
- var IE_PROTO = sharedKey('IE_PROTO');
9
8
 
9
+ var GT = '>';
10
+ var LT = '<';
10
11
  var PROTOTYPE = 'prototype';
11
- var Empty = function () { /* empty */ };
12
+ var SCRIPT = 'script';
13
+ var IE_PROTO = sharedKey('IE_PROTO');
14
+
15
+ var EmptyConstructor = function () { /* empty */ };
16
+
17
+ var scriptTag = function (content) {
18
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
19
+ };
20
+
21
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
22
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
23
+ activeXDocument.write(scriptTag(''));
24
+ activeXDocument.close();
25
+ var temp = activeXDocument.parentWindow.Object;
26
+ activeXDocument = null; // avoid memory leak
27
+ return temp;
28
+ };
12
29
 
13
30
  // Create object with fake `null` prototype: use iframe Object with cleared prototype
14
- var createDict = function () {
31
+ var NullProtoObjectViaIFrame = function () {
15
32
  // Thrash, waste and sodomy: IE GC bug
16
33
  var iframe = documentCreateElement('iframe');
17
- var length = enumBugKeys.length;
18
- var lt = '<';
19
- var script = 'script';
20
- var gt = '>';
21
- var js = 'java' + script + ':';
34
+ var JS = 'java' + SCRIPT + ':';
22
35
  var iframeDocument;
23
36
  iframe.style.display = 'none';
24
37
  html.appendChild(iframe);
25
- iframe.src = String(js);
38
+ // https://github.com/zloirock/core-js/issues/475
39
+ iframe.src = String(JS);
26
40
  iframeDocument = iframe.contentWindow.document;
27
41
  iframeDocument.open();
28
- iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
42
+ iframeDocument.write(scriptTag('document.F=Object'));
29
43
  iframeDocument.close();
30
- createDict = iframeDocument.F;
31
- while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
32
- return createDict();
44
+ return iframeDocument.F;
33
45
  };
34
46
 
47
+ // Check for document.domain and active x support
48
+ // No need to use active x approach when document.domain is not set
49
+ // see https://github.com/es-shims/es5-shim/issues/150
50
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
51
+ // avoid IE GC bug
52
+ var activeXDocument;
53
+ var NullProtoObject = function () {
54
+ try {
55
+ /* global ActiveXObject */
56
+ activeXDocument = document.domain && new ActiveXObject('htmlfile');
57
+ } catch (error) { /* ignore */ }
58
+ NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
59
+ var length = enumBugKeys.length;
60
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
61
+ return NullProtoObject();
62
+ };
63
+
64
+ hiddenKeys[IE_PROTO] = true;
65
+
35
66
  // `Object.create` method
36
67
  // https://tc39.github.io/ecma262/#sec-object.create
37
68
  module.exports = Object.create || function create(O, Properties) {
38
69
  var result;
39
70
  if (O !== null) {
40
- Empty[PROTOTYPE] = anObject(O);
41
- result = new Empty();
42
- Empty[PROTOTYPE] = null;
71
+ EmptyConstructor[PROTOTYPE] = anObject(O);
72
+ result = new EmptyConstructor();
73
+ EmptyConstructor[PROTOTYPE] = null;
43
74
  // add "__proto__" for Object.getPrototypeOf polyfill
44
75
  result[IE_PROTO] = O;
45
- } else result = createDict();
76
+ } else result = NullProtoObject();
46
77
  return Properties === undefined ? result : defineProperties(result, Properties);
47
78
  };
48
-
49
- hiddenKeys[IE_PROTO] = true;
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+ var InternalStateModule = require('../internals/internal-state');
3
+ var createIteratorConstructor = require('../internals/create-iterator-constructor');
4
+ var has = require('../internals/has');
5
+ var objectKeys = require('../internals/object-keys');
6
+ var toObject = require('../internals/to-object');
7
+
8
+ var OBJECT_ITERATOR = 'Object Iterator';
9
+ var setInternalState = InternalStateModule.set;
10
+ var getInternalState = InternalStateModule.getterFor(OBJECT_ITERATOR);
11
+
12
+ module.exports = createIteratorConstructor(function ObjectIterator(source, mode) {
13
+ var object = toObject(source);
14
+ setInternalState(this, {
15
+ type: OBJECT_ITERATOR,
16
+ mode: mode,
17
+ object: object,
18
+ keys: objectKeys(object),
19
+ index: 0
20
+ });
21
+ }, 'Object', function next() {
22
+ var state = getInternalState(this);
23
+ var keys = state.keys;
24
+ while (true) {
25
+ if (keys === null || state.index >= keys.length) {
26
+ state.object = state.keys = null;
27
+ return { value: undefined, done: true };
28
+ }
29
+ var key = keys[state.index++];
30
+ var object = state.object;
31
+ if (!has(object, key)) continue;
32
+ switch (state.mode) {
33
+ case 'keys': return { value: key, done: false };
34
+ case 'values': return { value: object[key], done: false };
35
+ } /* entries */ return { value: [key, object[key]], done: false };
36
+ }
37
+ });
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  var regexpFlags = require('./regexp-flags');
3
+ var stickyHelpers = require('./regexp-sticky-helpers');
3
4
 
4
5
  var nativeExec = RegExp.prototype.exec;
5
6
  // This always refers to the native implementation, because the
@@ -17,24 +18,56 @@ var UPDATES_LAST_INDEX_WRONG = (function () {
17
18
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
18
19
  })();
19
20
 
21
+ var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
22
+
20
23
  // nonparticipating capturing group, copied from es5-shim's String#split patch.
21
24
  var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
22
25
 
23
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
26
+ var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
24
27
 
25
28
  if (PATCH) {
26
29
  patchedExec = function exec(str) {
27
30
  var re = this;
28
31
  var lastIndex, reCopy, match, i;
32
+ var sticky = UNSUPPORTED_Y && re.sticky;
33
+ var flags = regexpFlags.call(re);
34
+ var source = re.source;
35
+ var charsAdded = 0;
36
+ var strCopy = str;
37
+
38
+ if (sticky) {
39
+ flags = flags.replace('y', '');
40
+ if (flags.indexOf('g') === -1) {
41
+ flags += 'g';
42
+ }
43
+
44
+ strCopy = String(str).slice(re.lastIndex);
45
+ // Support anchored sticky behavior.
46
+ if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
47
+ source = '(?: ' + source + ')';
48
+ strCopy = ' ' + strCopy;
49
+ charsAdded++;
50
+ }
51
+ // ^(? + rx + ) is needed, in combination with some str slicing, to
52
+ // simulate the 'y' flag.
53
+ reCopy = new RegExp('^(?:' + source + ')', flags);
54
+ }
29
55
 
30
56
  if (NPCG_INCLUDED) {
31
- reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
57
+ reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
32
58
  }
33
59
  if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
34
60
 
35
- match = nativeExec.call(re, str);
61
+ match = nativeExec.call(sticky ? reCopy : re, strCopy);
36
62
 
37
- if (UPDATES_LAST_INDEX_WRONG && match) {
63
+ if (sticky) {
64
+ if (match) {
65
+ match.input = match.input.slice(charsAdded);
66
+ match[0] = match[0].slice(charsAdded);
67
+ match.index = re.lastIndex;
68
+ re.lastIndex += match[0].length;
69
+ } else re.lastIndex = 0;
70
+ } else if (UPDATES_LAST_INDEX_WRONG && match) {
38
71
  re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
39
72
  }
40
73
  if (NPCG_INCLUDED && match && match.length > 1) {
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var fails = require('./fails');
4
+
5
+ // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
6
+ // so we use an intermediate function.
7
+ function RE(s, f) {
8
+ return RegExp(s, f);
9
+ }
10
+
11
+ exports.UNSUPPORTED_Y = fails(function () {
12
+ // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
13
+ var re = RE('a', 'y');
14
+ re.lastIndex = 2;
15
+ return re.exec('abcd') != null;
16
+ });
17
+
18
+ exports.BROKEN_CARET = fails(function () {
19
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
20
+ var re = RE('^r', 'gy');
21
+ re.lastIndex = 2;
22
+ return re.exec('str') != null;
23
+ });
@@ -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.4.8',
7
+ version: '3.6.2',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
- copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
9
+ copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -1,5 +1,5 @@
1
1
  // https://github.com/zloirock/core-js/issues/280
2
- var userAgent = require('../internals/user-agent');
2
+ var userAgent = require('../internals/engine-user-agent');
3
3
 
4
4
  // eslint-disable-next-line unicorn/no-unsafe-regex
5
5
  module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
package/internals/task.js CHANGED
@@ -1,10 +1,10 @@
1
1
  var global = require('../internals/global');
2
2
  var fails = require('../internals/fails');
3
3
  var classof = require('../internals/classof-raw');
4
- var bind = require('../internals/bind-context');
4
+ var bind = require('../internals/function-bind-context');
5
5
  var html = require('../internals/html');
6
6
  var createElement = require('../internals/document-create-element');
7
- var IS_IOS = require('../internals/is-ios');
7
+ var IS_IOS = require('../internals/engine-is-ios');
8
8
 
9
9
  var location = global.location;
10
10
  var set = global.setImmediate;
@@ -2,7 +2,7 @@
2
2
  var $ = require('../internals/export');
3
3
  var global = require('../internals/global');
4
4
  var DESCRIPTORS = require('../internals/descriptors');
5
- var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-arrays-constructors-requires-wrappers');
5
+ var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');
6
6
  var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
7
7
  var ArrayBufferModule = require('../internals/array-buffer');
8
8
  var anInstance = require('../internals/an-instance');
@@ -2,7 +2,7 @@ var toObject = require('../internals/to-object');
2
2
  var toLength = require('../internals/to-length');
3
3
  var getIteratorMethod = require('../internals/get-iterator-method');
4
4
  var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
5
- var bind = require('../internals/bind-context');
5
+ var bind = require('../internals/function-bind-context');
6
6
  var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;
7
7
 
8
8
  module.exports = function from(source /* , mapfn, thisArg */) {
@@ -4,4 +4,4 @@ module.exports = NATIVE_SYMBOL
4
4
  // eslint-disable-next-line no-undef
5
5
  && !Symbol.sham
6
6
  // eslint-disable-next-line no-undef
7
- && typeof Symbol() == 'symbol';
7
+ && typeof Symbol.iterator == 'symbol';
@@ -7,7 +7,7 @@ var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
7
7
 
8
8
  var WellKnownSymbolsStore = shared('wks');
9
9
  var Symbol = global.Symbol;
10
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : uid;
10
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
11
11
 
12
12
  module.exports = function (name) {
13
13
  if (!has(WellKnownSymbolsStore, name)) {
@@ -9,7 +9,7 @@ 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
+ var V8_VERSION = require('../internals/engine-v8-version');
13
13
 
14
14
  var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
15
15
  var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
@@ -1,11 +1,15 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $every = require('../internals/array-iteration').every;
4
- var sloppyArrayMethod = require('../internals/sloppy-array-method');
4
+ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
6
+
7
+ var STRICT_METHOD = arrayMethodIsStrict('every');
8
+ var USES_TO_LENGTH = arrayMethodUsesToLength('every');
5
9
 
6
10
  // `Array.prototype.every` method
7
11
  // https://tc39.github.io/ecma262/#sec-array.prototype.every
8
- $({ target: 'Array', proto: true, forced: sloppyArrayMethod('every') }, {
12
+ $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
9
13
  every: function every(callbackfn /* , thisArg */) {
10
14
  return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
11
15
  }
@@ -1,14 +1,12 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $filter = require('../internals/array-iteration').filter;
4
- var fails = require('../internals/fails');
5
4
  var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
5
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
6
6
 
7
7
  var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
8
8
  // Edge 14- issue
9
- var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
10
- [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
11
- });
9
+ var USES_TO_LENGTH = arrayMethodUsesToLength('filter');
12
10
 
13
11
  // `Array.prototype.filter` method
14
12
  // https://tc39.github.io/ecma262/#sec-array.prototype.filter
@@ -2,16 +2,19 @@
2
2
  var $ = require('../internals/export');
3
3
  var $findIndex = require('../internals/array-iteration').findIndex;
4
4
  var addToUnscopables = require('../internals/add-to-unscopables');
5
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
5
6
 
6
7
  var FIND_INDEX = 'findIndex';
7
8
  var SKIPS_HOLES = true;
8
9
 
10
+ var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX);
11
+
9
12
  // Shouldn't skip holes
10
13
  if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
11
14
 
12
15
  // `Array.prototype.findIndex` method
13
16
  // https://tc39.github.io/ecma262/#sec-array.prototype.findindex
14
- $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
17
+ $({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
15
18
  findIndex: function findIndex(callbackfn /* , that = undefined */) {
16
19
  return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
17
20
  }
@@ -2,16 +2,19 @@
2
2
  var $ = require('../internals/export');
3
3
  var $find = require('../internals/array-iteration').find;
4
4
  var addToUnscopables = require('../internals/add-to-unscopables');
5
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
5
6
 
6
7
  var FIND = 'find';
7
8
  var SKIPS_HOLES = true;
8
9
 
10
+ var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
11
+
9
12
  // Shouldn't skip holes
10
13
  if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
11
14
 
12
15
  // `Array.prototype.find` method
13
16
  // https://tc39.github.io/ecma262/#sec-array.prototype.find
14
- $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
17
+ $({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
15
18
  find: function find(callbackfn /* , that = undefined */) {
16
19
  return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
17
20
  }
@@ -2,10 +2,13 @@
2
2
  var $ = require('../internals/export');
3
3
  var $includes = require('../internals/array-includes').includes;
4
4
  var addToUnscopables = require('../internals/add-to-unscopables');
5
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
6
+
7
+ var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
5
8
 
6
9
  // `Array.prototype.includes` method
7
10
  // https://tc39.github.io/ecma262/#sec-array.prototype.includes
8
- $({ target: 'Array', proto: true }, {
11
+ $({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
9
12
  includes: function includes(el /* , fromIndex = 0 */) {
10
13
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
11
14
  }
@@ -1,16 +1,18 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $indexOf = require('../internals/array-includes').indexOf;
4
- var sloppyArrayMethod = require('../internals/sloppy-array-method');
4
+ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
5
6
 
6
7
  var nativeIndexOf = [].indexOf;
7
8
 
8
9
  var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
9
- var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
10
+ var STRICT_METHOD = arrayMethodIsStrict('indexOf');
11
+ var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
10
12
 
11
13
  // `Array.prototype.indexOf` method
12
14
  // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
13
- $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
15
+ $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
14
16
  indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
15
17
  return NEGATIVE_ZERO
16
18
  // convert -0 to +0
@@ -2,16 +2,16 @@
2
2
  var $ = require('../internals/export');
3
3
  var IndexedObject = require('../internals/indexed-object');
4
4
  var toIndexedObject = require('../internals/to-indexed-object');
5
- var sloppyArrayMethod = require('../internals/sloppy-array-method');
5
+ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
6
6
 
7
7
  var nativeJoin = [].join;
8
8
 
9
9
  var ES3_STRINGS = IndexedObject != Object;
10
- var SLOPPY_METHOD = sloppyArrayMethod('join', ',');
10
+ var STRICT_METHOD = arrayMethodIsStrict('join', ',');
11
11
 
12
12
  // `Array.prototype.join` method
13
13
  // https://tc39.github.io/ecma262/#sec-array.prototype.join
14
- $({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, {
14
+ $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
15
15
  join: function join(separator) {
16
16
  return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
17
17
  }
@@ -1,14 +1,12 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $map = require('../internals/array-iteration').map;
4
- var fails = require('../internals/fails');
5
4
  var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
5
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
6
6
 
7
7
  var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
8
8
  // FF49- issue
9
- var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
10
- [].map.call({ length: -1, 0: 1 }, function (it) { throw it; });
11
- });
9
+ var USES_TO_LENGTH = arrayMethodUsesToLength('map');
12
10
 
13
11
  // `Array.prototype.map` method
14
12
  // https://tc39.github.io/ecma262/#sec-array.prototype.map
@@ -1,11 +1,15 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $reduceRight = require('../internals/array-reduce').right;
4
- var sloppyArrayMethod = require('../internals/sloppy-array-method');
4
+ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
6
+
7
+ var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
8
+ var USES_TO_LENGTH = arrayMethodUsesToLength('reduceRight', { 1: 0 });
5
9
 
6
10
  // `Array.prototype.reduceRight` method
7
11
  // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
8
- $({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduceRight') }, {
12
+ $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
9
13
  reduceRight: function reduceRight(callbackfn /* , initialValue */) {
10
14
  return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
11
15
  }