core-js 3.12.0 → 3.12.1

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.
@@ -2,11 +2,13 @@
2
2
  // TODO: Remove from `core-js@4` since it's moved to entry points
3
3
  require('../modules/es.regexp.exec');
4
4
  var redefine = require('../internals/redefine');
5
+ var regexpExec = require('../internals/regexp-exec');
5
6
  var fails = require('../internals/fails');
6
7
  var wellKnownSymbol = require('../internals/well-known-symbol');
7
8
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
8
9
 
9
10
  var SPECIES = wellKnownSymbol('species');
11
+ var RegExpPrototype = RegExp.prototype;
10
12
 
11
13
  var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
12
14
  // #replace needs built-in support for named groups.
@@ -94,7 +96,8 @@ module.exports = function (KEY, length, exec, sham) {
94
96
  ) {
95
97
  var nativeRegExpMethod = /./[SYMBOL];
96
98
  var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
97
- if (regexp.exec === RegExp.prototype.exec) {
99
+ var $exec = regexp.exec;
100
+ if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
98
101
  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
99
102
  // The native String method already delegates to @@method (this
100
103
  // polyfilled function), leasing to infinite recursion.
@@ -112,7 +115,7 @@ module.exports = function (KEY, length, exec, sham) {
112
115
  var regexMethod = methods[1];
113
116
 
114
117
  redefine(String.prototype, KEY, stringMethod);
115
- redefine(RegExp.prototype, SYMBOL, length == 2
118
+ redefine(RegExpPrototype, SYMBOL, length == 2
116
119
  // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
117
120
  // 21.2.5.11 RegExp.prototype[@@split](string, limit)
118
121
  ? function (string, arg) { return regexMethod.call(string, this, arg); }
@@ -122,5 +125,5 @@ module.exports = function (KEY, length, exec, sham) {
122
125
  );
123
126
  }
124
127
 
125
- if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
128
+ if (sham) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
126
129
  };
@@ -24,7 +24,7 @@ var getterFor = function (TYPE) {
24
24
  };
25
25
  };
26
26
 
27
- if (NATIVE_WEAK_MAP) {
27
+ if (NATIVE_WEAK_MAP || shared.state) {
28
28
  var store = shared.state || (shared.state = new WeakMap());
29
29
  var wmget = store.get;
30
30
  var wmhas = store.has;
@@ -1,4 +1,6 @@
1
1
  'use strict';
2
+ /* eslint-disable regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
3
+ /* eslint-disable regexp/no-useless-quantifier -- testing */
2
4
  var regexpFlags = require('./regexp-flags');
3
5
  var stickyHelpers = require('./regexp-sticky-helpers');
4
6
  var shared = require('./shared');
@@ -19,7 +21,6 @@ var UPDATES_LAST_INDEX_WRONG = (function () {
19
21
  var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
20
22
 
21
23
  // nonparticipating capturing group, copied from es5-shim's String#split patch.
22
- // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing
23
24
  var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
24
25
 
25
26
  var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
@@ -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.12.0',
7
+ version: '3.12.1',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
10
10
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js",
3
3
  "description": "Standard library",
4
- "version": "3.12.0",
4
+ "version": "3.12.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git",
@@ -55,5 +55,5 @@
55
55
  "scripts": {
56
56
  "postinstall": "node -e \"try{require('./postinstall')}catch(e){}\""
57
57
  },
58
- "gitHead": "1aadb7b20d500abb53b6d721b75974571dd54b26"
58
+ "gitHead": "8752e6940ac87e35a05c7a0df53cdc781bb73c8d"
59
59
  }