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,11 +1,15 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $reduce = require('../internals/array-reduce').left;
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('reduce');
8
+ var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
5
9
 
6
10
  // `Array.prototype.reduce` method
7
11
  // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
8
- $({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, {
12
+ $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
9
13
  reduce: function reduce(callbackfn /* , initialValue */) {
10
14
  return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
11
15
  }
@@ -6,8 +6,12 @@ var toAbsoluteIndex = require('../internals/to-absolute-index');
6
6
  var toLength = require('../internals/to-length');
7
7
  var toIndexedObject = require('../internals/to-indexed-object');
8
8
  var createProperty = require('../internals/create-property');
9
- var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
10
9
  var wellKnownSymbol = require('../internals/well-known-symbol');
10
+ var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
11
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
12
+
13
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
14
+ var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });
11
15
 
12
16
  var SPECIES = wellKnownSymbol('species');
13
17
  var nativeSlice = [].slice;
@@ -16,7 +20,7 @@ var max = Math.max;
16
20
  // `Array.prototype.slice` method
17
21
  // https://tc39.github.io/ecma262/#sec-array.prototype.slice
18
22
  // fallback for not array-like ES3 strings and DOM objects
19
- $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
23
+ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
20
24
  slice: function slice(start, end) {
21
25
  var O = toIndexedObject(this);
22
26
  var length = toLength(O.length);
@@ -1,11 +1,15 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $some = require('../internals/array-iteration').some;
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('some');
8
+ var USES_TO_LENGTH = arrayMethodUsesToLength('some');
5
9
 
6
10
  // `Array.prototype.some` method
7
11
  // https://tc39.github.io/ecma262/#sec-array.prototype.some
8
- $({ target: 'Array', proto: true, forced: sloppyArrayMethod('some') }, {
12
+ $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
9
13
  some: function some(callbackfn /* , thisArg */) {
10
14
  return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
11
15
  }
@@ -3,7 +3,7 @@ var $ = require('../internals/export');
3
3
  var aFunction = require('../internals/a-function');
4
4
  var toObject = require('../internals/to-object');
5
5
  var fails = require('../internals/fails');
6
- var sloppyArrayMethod = require('../internals/sloppy-array-method');
6
+ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
7
7
 
8
8
  var test = [];
9
9
  var nativeSort = test.sort;
@@ -17,9 +17,9 @@ var FAILS_ON_NULL = fails(function () {
17
17
  test.sort(null);
18
18
  });
19
19
  // Old WebKit
20
- var SLOPPY_METHOD = sloppyArrayMethod('sort');
20
+ var STRICT_METHOD = arrayMethodIsStrict('sort');
21
21
 
22
- var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD;
22
+ var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD;
23
23
 
24
24
  // `Array.prototype.sort` method
25
25
  // https://tc39.github.io/ecma262/#sec-array.prototype.sort
@@ -7,6 +7,10 @@ var toObject = require('../internals/to-object');
7
7
  var arraySpeciesCreate = require('../internals/array-species-create');
8
8
  var createProperty = require('../internals/create-property');
9
9
  var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
10
+ var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
11
+
12
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
13
+ var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });
10
14
 
11
15
  var max = Math.max;
12
16
  var min = Math.min;
@@ -16,7 +20,7 @@ var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
16
20
  // `Array.prototype.splice` method
17
21
  // https://tc39.github.io/ecma262/#sec-array.prototype.splice
18
22
  // with adding support of @@species
19
- $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, {
23
+ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
20
24
  splice: function splice(start, deleteCount /* , ...items */) {
21
25
  var O = toObject(this);
22
26
  var len = toLength(O.length);
@@ -1,6 +1,6 @@
1
1
  var $ = require('../internals/export');
2
2
  var ArrayBufferModule = require('../internals/array-buffer');
3
- var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER;
3
+ var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');
4
4
 
5
5
  // `DataView` constructor
6
6
  // https://tc39.github.io/ecma262/#sec-dataview-constructor
@@ -1,5 +1,5 @@
1
1
  var $ = require('../internals/export');
2
- var parseFloat = require('../internals/parse-float');
2
+ var parseFloat = require('../internals/number-parse-float');
3
3
 
4
4
  // `Number.parseFloat` method
5
5
  // https://tc39.github.io/ecma262/#sec-number.parseFloat
@@ -1,5 +1,5 @@
1
1
  var $ = require('../internals/export');
2
- var parseInt = require('../internals/parse-int');
2
+ var parseInt = require('../internals/number-parse-int');
3
3
 
4
4
  // `Number.parseInt` method
5
5
  // https://tc39.github.io/ecma262/#sec-number.parseint
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var DESCRIPTORS = require('../internals/descriptors');
4
- var FORCED = require('../internals/forced-object-prototype-accessors-methods');
4
+ var FORCED = require('../internals/object-prototype-accessors-forced');
5
5
  var toObject = require('../internals/to-object');
6
6
  var aFunction = require('../internals/a-function');
7
7
  var definePropertyModule = require('../internals/object-define-property');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var DESCRIPTORS = require('../internals/descriptors');
4
- var FORCED = require('../internals/forced-object-prototype-accessors-methods');
4
+ var FORCED = require('../internals/object-prototype-accessors-forced');
5
5
  var toObject = require('../internals/to-object');
6
6
  var aFunction = require('../internals/a-function');
7
7
  var definePropertyModule = require('../internals/object-define-property');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var DESCRIPTORS = require('../internals/descriptors');
4
- var FORCED = require('../internals/forced-object-prototype-accessors-methods');
4
+ var FORCED = require('../internals/object-prototype-accessors-forced');
5
5
  var toObject = require('../internals/to-object');
6
6
  var toPrimitive = require('../internals/to-primitive');
7
7
  var getPrototypeOf = require('../internals/object-get-prototype-of');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var DESCRIPTORS = require('../internals/descriptors');
4
- var FORCED = require('../internals/forced-object-prototype-accessors-methods');
4
+ var FORCED = require('../internals/object-prototype-accessors-forced');
5
5
  var toObject = require('../internals/to-object');
6
6
  var toPrimitive = require('../internals/to-primitive');
7
7
  var getPrototypeOf = require('../internals/object-get-prototype-of');
@@ -1,5 +1,5 @@
1
1
  var $ = require('../internals/export');
2
- var parseFloatImplementation = require('../internals/parse-float');
2
+ var parseFloatImplementation = require('../internals/number-parse-float');
3
3
 
4
4
  // `parseFloat` method
5
5
  // https://tc39.github.io/ecma262/#sec-parsefloat-string
@@ -1,5 +1,5 @@
1
1
  var $ = require('../internals/export');
2
- var parseIntImplementation = require('../internals/parse-int');
2
+ var parseIntImplementation = require('../internals/number-parse-int');
3
3
 
4
4
  // `parseInt` method
5
5
  // https://tc39.github.io/ecma262/#sec-parseint-string-radix
@@ -25,7 +25,7 @@ var perform = require('../internals/perform');
25
25
  var InternalStateModule = require('../internals/internal-state');
26
26
  var isForced = require('../internals/is-forced');
27
27
  var wellKnownSymbol = require('../internals/well-known-symbol');
28
- var V8_VERSION = require('../internals/v8-version');
28
+ var V8_VERSION = require('../internals/engine-v8-version');
29
29
 
30
30
  var SPECIES = wellKnownSymbol('species');
31
31
  var PROMISE = 'Promise';
@@ -6,8 +6,10 @@ var defineProperty = require('../internals/object-define-property').f;
6
6
  var getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
7
7
  var isRegExp = require('../internals/is-regexp');
8
8
  var getFlags = require('../internals/regexp-flags');
9
+ var stickyHelpers = require('../internals/regexp-sticky-helpers');
9
10
  var redefine = require('../internals/redefine');
10
11
  var fails = require('../internals/fails');
12
+ var setInternalState = require('../internals/internal-state').set;
11
13
  var setSpecies = require('../internals/set-species');
12
14
  var wellKnownSymbol = require('../internals/well-known-symbol');
13
15
 
@@ -20,7 +22,9 @@ var re2 = /a/g;
20
22
  // "new" should create a new object, old webkit bug
21
23
  var CORRECT_NEW = new NativeRegExp(re1) !== re1;
22
24
 
23
- var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || fails(function () {
25
+ var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
26
+
27
+ var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {
24
28
  re2[MATCH] = false;
25
29
  // RegExp constructor can alter flags and IsRegExp works correct with @@match
26
30
  return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
@@ -33,13 +37,33 @@ if (FORCED) {
33
37
  var thisIsRegExp = this instanceof RegExpWrapper;
34
38
  var patternIsRegExp = isRegExp(pattern);
35
39
  var flagsAreUndefined = flags === undefined;
36
- return !thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined ? pattern
37
- : inheritIfRequired(CORRECT_NEW
38
- ? new NativeRegExp(patternIsRegExp && !flagsAreUndefined ? pattern.source : pattern, flags)
39
- : NativeRegExp((patternIsRegExp = pattern instanceof RegExpWrapper)
40
- ? pattern.source
41
- : pattern, patternIsRegExp && flagsAreUndefined ? getFlags.call(pattern) : flags)
42
- , thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
40
+ var sticky;
41
+
42
+ if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
43
+ return pattern;
44
+ }
45
+
46
+ if (CORRECT_NEW) {
47
+ if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
48
+ } else if (pattern instanceof RegExpWrapper) {
49
+ if (flagsAreUndefined) flags = getFlags.call(pattern);
50
+ pattern = pattern.source;
51
+ }
52
+
53
+ if (UNSUPPORTED_Y) {
54
+ sticky = !!flags && flags.indexOf('y') > -1;
55
+ if (sticky) flags = flags.replace(/y/g, '');
56
+ }
57
+
58
+ var result = inheritIfRequired(
59
+ CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
60
+ thisIsRegExp ? this : RegExpPrototype,
61
+ RegExpWrapper
62
+ );
63
+
64
+ if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky });
65
+
66
+ return result;
43
67
  };
44
68
  var proxy = function (key) {
45
69
  key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
@@ -1,10 +1,11 @@
1
1
  var DESCRIPTORS = require('../internals/descriptors');
2
2
  var objectDefinePropertyModule = require('../internals/object-define-property');
3
3
  var regExpFlags = require('../internals/regexp-flags');
4
+ var UNSUPPORTED_Y = require('../internals/regexp-sticky-helpers').UNSUPPORTED_Y;
4
5
 
5
6
  // `RegExp.prototype.flags` getter
6
7
  // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
7
- if (DESCRIPTORS && /./g.flags != 'g') {
8
+ if (DESCRIPTORS && (/./g.flags != 'g' || UNSUPPORTED_Y)) {
8
9
  objectDefinePropertyModule.f(RegExp.prototype, 'flags', {
9
10
  configurable: true,
10
11
  get: regExpFlags
@@ -0,0 +1,21 @@
1
+ var DESCRIPTORS = require('../internals/descriptors');
2
+ var UNSUPPORTED_Y = require('../internals/regexp-sticky-helpers').UNSUPPORTED_Y;
3
+ var defineProperty = require('../internals/object-define-property').f;
4
+ var getInternalState = require('../internals/internal-state').get;
5
+ var RegExpPrototype = RegExp.prototype;
6
+
7
+ // `RegExp.prototype.sticky` getter
8
+ if (DESCRIPTORS && UNSUPPORTED_Y) {
9
+ defineProperty(RegExp.prototype, 'sticky', {
10
+ configurable: true,
11
+ get: function () {
12
+ if (this === RegExpPrototype) return undefined;
13
+ // We can't use InternalStateModule.getterFor because
14
+ // we don't add metadata for regexps created by a literal.
15
+ if (this instanceof RegExp) {
16
+ return !!getInternalState(this).sticky;
17
+ }
18
+ throw TypeError('Incompatible receiver, RegExp required');
19
+ }
20
+ });
21
+ }
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+ // TODO: Remove from `core-js@4` since it's moved to entry points
3
+ require('../modules/es.regexp.exec');
4
+ var $ = require('../internals/export');
5
+ var isObject = require('../internals/is-object');
6
+
7
+ var DELEGATES_TO_EXEC = function () {
8
+ var execCalled = false;
9
+ var re = /[ac]/;
10
+ re.exec = function () {
11
+ execCalled = true;
12
+ return /./.exec.apply(this, arguments);
13
+ };
14
+ return re.test('abc') === true && execCalled;
15
+ }();
16
+
17
+ var nativeTest = /./.test;
18
+
19
+ $({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
20
+ test: function (str) {
21
+ if (typeof this.exec !== 'function') {
22
+ return nativeTest.call(this, str);
23
+ }
24
+ var result = this.exec(str);
25
+ if (result !== null && !isObject(result)) {
26
+ throw new Error('RegExp exec method returned something other than an Object or null');
27
+ }
28
+ return !!result;
29
+ }
30
+ });
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.anchor` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.anchor
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.big` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.big
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.blink` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.blink
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.bold` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.bold
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.fixed` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.fixed
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.fontcolor` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.fontcolor
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.fontsize` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.fontsize
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.italics` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.italics
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.link` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.link
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $padEnd = require('../internals/string-pad').end;
4
- var WEBKIT_BUG = require('../internals/webkit-string-pad-bug');
4
+ var WEBKIT_BUG = require('../internals/string-pad-webkit-bug');
5
5
 
6
6
  // `String.prototype.padEnd` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.padend
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $padStart = require('../internals/string-pad').start;
4
- var WEBKIT_BUG = require('../internals/webkit-string-pad-bug');
4
+ var WEBKIT_BUG = require('../internals/string-pad-webkit-bug');
5
5
 
6
6
  // `String.prototype.padStart` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.padstart
@@ -19,7 +19,7 @@ var maybeToString = function (it) {
19
19
  };
20
20
 
21
21
  // @@replace logic
22
- fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
22
+ fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
23
23
  return [
24
24
  // `String.prototype.replace` method
25
25
  // https://tc39.github.io/ecma262/#sec-string.prototype.replace
@@ -33,8 +33,10 @@ fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, ma
33
33
  // `RegExp.prototype[@@replace]` method
34
34
  // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
35
35
  function (regexp, replaceValue) {
36
- var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
37
- if (res.done) return res.value;
36
+ if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
37
+ var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
38
+ if (res.done) return res.value;
39
+ }
38
40
 
39
41
  var rx = anObject(regexp);
40
42
  var S = String(this);
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.small` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.small
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.strike` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.strike
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.sub` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.sub
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var createHTML = require('../internals/create-html');
4
- var forcedStringHTMLMethod = require('../internals/forced-string-html-method');
4
+ var forcedStringHTMLMethod = require('../internals/string-html-forced');
5
5
 
6
6
  // `String.prototype.sup` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.sup
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $trimEnd = require('../internals/string-trim').end;
4
- var forcedStringTrimMethod = require('../internals/forced-string-trim-method');
4
+ var forcedStringTrimMethod = require('../internals/string-trim-forced');
5
5
 
6
6
  var FORCED = forcedStringTrimMethod('trimEnd');
7
7
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $trimStart = require('../internals/string-trim').start;
4
- var forcedStringTrimMethod = require('../internals/forced-string-trim-method');
4
+ var forcedStringTrimMethod = require('../internals/string-trim-forced');
5
5
 
6
6
  var FORCED = forcedStringTrimMethod('trimStart');
7
7
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $trim = require('../internals/string-trim').trim;
4
- var forcedStringTrimMethod = require('../internals/forced-string-trim-method');
4
+ var forcedStringTrimMethod = require('../internals/string-trim-forced');
5
5
 
6
6
  // `String.prototype.trim` method
7
7
  // https://tc39.github.io/ecma262/#sec-string.prototype.trim
@@ -30,7 +30,7 @@ var sharedKey = require('../internals/shared-key');
30
30
  var hiddenKeys = require('../internals/hidden-keys');
31
31
  var uid = require('../internals/uid');
32
32
  var wellKnownSymbol = require('../internals/well-known-symbol');
33
- var wrappedWellKnownSymbolModule = require('../internals/wrapped-well-known-symbol');
33
+ var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');
34
34
  var defineWellKnownSymbol = require('../internals/define-well-known-symbol');
35
35
  var setToStringTag = require('../internals/set-to-string-tag');
36
36
  var InternalStateModule = require('../internals/internal-state');
@@ -83,7 +83,7 @@ var wrap = function (tag, description) {
83
83
  return symbol;
84
84
  };
85
85
 
86
- var isSymbol = NATIVE_SYMBOL && typeof $Symbol.iterator == 'symbol' ? function (it) {
86
+ var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
87
87
  return typeof it == 'symbol';
88
88
  } : function (it) {
89
89
  return Object(it) instanceof $Symbol;
@@ -178,12 +178,20 @@ if (!NATIVE_SYMBOL) {
178
178
  return getInternalState(this).tag;
179
179
  });
180
180
 
181
+ redefine($Symbol, 'withoutSetter', function (description) {
182
+ return wrap(uid(description), description);
183
+ });
184
+
181
185
  propertyIsEnumerableModule.f = $propertyIsEnumerable;
182
186
  definePropertyModule.f = $defineProperty;
183
187
  getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
184
188
  getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
185
189
  getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
186
190
 
191
+ wrappedWellKnownSymbolModule.f = function (name) {
192
+ return wrap(wellKnownSymbol(name), name);
193
+ };
194
+
187
195
  if (DESCRIPTORS) {
188
196
  // https://github.com/tc39/proposal-Symbol-description
189
197
  nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
@@ -198,12 +206,6 @@ if (!NATIVE_SYMBOL) {
198
206
  }
199
207
  }
200
208
 
201
- if (!USE_SYMBOL_AS_UID) {
202
- wrappedWellKnownSymbolModule.f = function (name) {
203
- return wrap(wellKnownSymbol(name), name);
204
- };
205
- }
206
-
207
209
  $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
208
210
  Symbol: $Symbol
209
211
  });
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
- var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-arrays-constructors-requires-wrappers');
2
+ var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');
3
3
  var exportTypedArrayStaticMethod = require('../internals/array-buffer-view-core').exportTypedArrayStaticMethod;
4
4
  var typedArrayFrom = require('../internals/typed-array-from');
5
5
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
3
- var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-arrays-constructors-requires-wrappers');
3
+ var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');
4
4
 
5
5
  var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
6
6
  var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod;
@@ -2,7 +2,7 @@
2
2
  // https://github.com/tc39/proposal-iterator-helpers
3
3
  var $ = require('../internals/export');
4
4
  var anObject = require('../internals/an-object');
5
- var createAsyncIteratorProxy = require('../internals/create-async-iterator-proxy');
5
+ var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
6
6
 
7
7
  var AsyncIteratorProxy = createAsyncIteratorProxy(function (arg, Promise) {
8
8
  var state = this;
@@ -3,7 +3,7 @@
3
3
  var $ = require('../internals/export');
4
4
  var anObject = require('../internals/an-object');
5
5
  var toPositiveInteger = require('../internals/to-positive-integer');
6
- var createAsyncIteratorProxy = require('../internals/create-async-iterator-proxy');
6
+ var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
7
7
 
8
8
  var AsyncIteratorProxy = createAsyncIteratorProxy(function (arg, Promise) {
9
9
  var state = this;