core-js 3.15.0 → 3.15.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.
@@ -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.15.0',
7
+ version: '3.15.1',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -113,17 +113,16 @@ if (isForced('RegExp', BASE_FORCED)) {
113
113
  var patternIsRegExp = isRegExp(pattern);
114
114
  var flagsAreUndefined = flags === undefined;
115
115
  var groups = [];
116
- var rawPattern, rawFlags, dotAll, sticky, handled, result, state;
116
+ var rawPattern = pattern;
117
+ var rawFlags, dotAll, sticky, handled, result, state;
117
118
 
118
- if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
119
+ if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
119
120
  return pattern;
120
121
  }
121
122
 
122
- if (CORRECT_NEW) {
123
- if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
124
- } else if (pattern instanceof RegExpWrapper) {
125
- if (flagsAreUndefined) flags = getFlags.call(pattern);
123
+ if (patternIsRegExp || pattern instanceof RegExpWrapper) {
126
124
  pattern = pattern.source;
125
+ if (flagsAreUndefined) flags = 'flags' in rawPattern ? rawPattern.flags : getFlags.call(rawPattern);
127
126
  }
128
127
 
129
128
  pattern = pattern === undefined ? '' : String(pattern);
@@ -148,11 +147,7 @@ if (isForced('RegExp', BASE_FORCED)) {
148
147
  groups = handled[1];
149
148
  }
150
149
 
151
- result = inheritIfRequired(
152
- CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
153
- thisIsRegExp ? this : RegExpPrototype,
154
- RegExpWrapper
155
- );
150
+ result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
156
151
 
157
152
  if (dotAll || sticky || groups.length) {
158
153
  state = enforceInternalState(result);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js",
3
3
  "description": "Standard library",
4
- "version": "3.15.0",
4
+ "version": "3.15.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": "4f7f304e7472127efc4749323c56819312fb327f"
58
+ "gitHead": "d7409d106383f252ab25215a287d9b8160785918"
59
59
  }