core-js 2.6.0 → 2.6.4

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.
@@ -1,2 +1,2 @@
1
- var core = module.exports = { version: '2.6.0' };
1
+ var core = module.exports = { version: '2.6.4' };
2
2
  if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
@@ -0,0 +1 @@
1
+ module.exports = require('./_shared')('native-function-to-string', Function.toString);
@@ -0,0 +1,4 @@
1
+ var nativeFunctionToString = require('./_function-to-string');
2
+ var WeakMap = require('./_global').WeakMap;
3
+
4
+ module.exports = typeof WeakMap === 'function' && /native code/.test(nativeFunctionToString.call(WeakMap));
@@ -8,5 +8,5 @@ var store = global[SHARED] || (global[SHARED] = {});
8
8
  })('versions', []).push({
9
9
  version: core.version,
10
10
  mode: require('./_library') ? 'pure' : 'global',
11
- copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
11
+ copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
12
12
  });
@@ -1,17 +1,18 @@
1
1
  'use strict';
2
+ var global = require('./_global');
2
3
  var each = require('./_array-methods')(0);
3
4
  var redefine = require('./_redefine');
4
5
  var meta = require('./_meta');
5
6
  var assign = require('./_object-assign');
6
7
  var weak = require('./_collection-weak');
7
8
  var isObject = require('./_is-object');
8
- var fails = require('./_fails');
9
9
  var validate = require('./_validate-collection');
10
+ var NATIVE_WEAK_MAP = require('./_validate-collection');
11
+ var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
10
12
  var WEAK_MAP = 'WeakMap';
11
13
  var getWeak = meta.getWeak;
12
14
  var isExtensible = Object.isExtensible;
13
15
  var uncaughtFrozenStore = weak.ufstore;
14
- var tmp = {};
15
16
  var InternalMap;
16
17
 
17
18
  var wrapper = function (get) {
@@ -39,7 +40,7 @@ var methods = {
39
40
  var $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);
40
41
 
41
42
  // IE11 WeakMap frozen keys fix
42
- if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {
43
+ if (NATIVE_WEAK_MAP && IS_IE11) {
43
44
  InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
44
45
  assign(InternalMap.prototype, methods);
45
46
  meta.NEED = true;
package/modules/_core.js CHANGED
@@ -1,2 +1,2 @@
1
- var core = module.exports = { version: '2.6.0' };
1
+ var core = module.exports = { version: '2.6.4' };
2
2
  if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
@@ -0,0 +1 @@
1
+ module.exports = require('./_shared')('native-function-to-string', Function.toString);
@@ -0,0 +1,4 @@
1
+ var nativeFunctionToString = require('./_function-to-string');
2
+ var WeakMap = require('./_global').WeakMap;
3
+
4
+ module.exports = typeof WeakMap === 'function' && /native code/.test(nativeFunctionToString.call(WeakMap));
@@ -2,8 +2,8 @@ var global = require('./_global');
2
2
  var hide = require('./_hide');
3
3
  var has = require('./_has');
4
4
  var SRC = require('./_uid')('src');
5
+ var $toString = require('./_function-to-string');
5
6
  var TO_STRING = 'toString';
6
- var $toString = Function[TO_STRING];
7
7
  var TPL = ('' + $toString).split(TO_STRING);
8
8
 
9
9
  require('./_core').inspectSource = function (it) {
@@ -8,5 +8,5 @@ var store = global[SHARED] || (global[SHARED] = {});
8
8
  })('versions', []).push({
9
9
  version: core.version,
10
10
  mode: require('./_library') ? 'pure' : 'global',
11
- copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
11
+ copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
12
12
  });
@@ -103,12 +103,12 @@ require('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace, may
103
103
  break;
104
104
  default: // \d\d?
105
105
  var n = +ch;
106
- if (n === 0) return ch;
106
+ if (n === 0) return match;
107
107
  if (n > m) {
108
108
  var f = floor(n / 10);
109
- if (f === 0) return ch;
109
+ if (f === 0) return match;
110
110
  if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
111
- return ch;
111
+ return match;
112
112
  }
113
113
  capture = captures[n - 1];
114
114
  }
@@ -7,18 +7,20 @@ var advanceStringIndex = require('./_advance-string-index');
7
7
  var toLength = require('./_to-length');
8
8
  var callRegExpExec = require('./_regexp-exec-abstract');
9
9
  var regexpExec = require('./_regexp-exec');
10
+ var fails = require('./_fails');
10
11
  var $min = Math.min;
11
12
  var $push = [].push;
12
13
  var $SPLIT = 'split';
13
14
  var LENGTH = 'length';
14
15
  var LAST_INDEX = 'lastIndex';
16
+ var MAX_UINT32 = 0xffffffff;
15
17
 
16
- // eslint-disable-next-line no-empty
17
- var SUPPORTS_Y = !!(function () { try { return new RegExp('x', 'y'); } catch (e) {} })();
18
+ // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
19
+ var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });
18
20
 
19
21
  // @@split logic
20
22
  require('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
21
- var internalSplit = $split;
23
+ var internalSplit;
22
24
  if (
23
25
  'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
24
26
  'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
@@ -39,7 +41,7 @@ require('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split, maybeCall
39
41
  (separator.unicode ? 'u' : '') +
40
42
  (separator.sticky ? 'y' : '');
41
43
  var lastLastIndex = 0;
42
- var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
44
+ var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
43
45
  // Make `global` and avoid `lastIndex` issues by working with a copy
44
46
  var separatorCopy = new RegExp(separator.source, flags + 'g');
45
47
  var match, lastIndex, lastLength;
@@ -64,6 +66,8 @@ require('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split, maybeCall
64
66
  internalSplit = function (separator, limit) {
65
67
  return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
66
68
  };
69
+ } else {
70
+ internalSplit = $split;
67
71
  }
68
72
 
69
73
  return [
@@ -91,14 +95,14 @@ require('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split, maybeCall
91
95
 
92
96
  var unicodeMatching = rx.unicode;
93
97
  var flags = (rx.ignoreCase ? 'i' : '') +
94
- (rx.multiline ? 'm' : '') +
95
- (rx.unicode ? 'u' : '') +
96
- (SUPPORTS_Y ? 'y' : 'g');
98
+ (rx.multiline ? 'm' : '') +
99
+ (rx.unicode ? 'u' : '') +
100
+ (SUPPORTS_Y ? 'y' : 'g');
97
101
 
98
102
  // ^(? + rx + ) is needed, in combination with some S slicing, to
99
103
  // simulate the 'y' flag.
100
104
  var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
101
- var lim = limit === undefined ? 0xffffffff : limit >>> 0;
105
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
102
106
  if (lim === 0) return [];
103
107
  if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
104
108
  var p = 0;
@@ -1,17 +1,18 @@
1
1
  'use strict';
2
+ var global = require('./_global');
2
3
  var each = require('./_array-methods')(0);
3
4
  var redefine = require('./_redefine');
4
5
  var meta = require('./_meta');
5
6
  var assign = require('./_object-assign');
6
7
  var weak = require('./_collection-weak');
7
8
  var isObject = require('./_is-object');
8
- var fails = require('./_fails');
9
9
  var validate = require('./_validate-collection');
10
+ var NATIVE_WEAK_MAP = require('./_validate-collection');
11
+ var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
10
12
  var WEAK_MAP = 'WeakMap';
11
13
  var getWeak = meta.getWeak;
12
14
  var isExtensible = Object.isExtensible;
13
15
  var uncaughtFrozenStore = weak.ufstore;
14
- var tmp = {};
15
16
  var InternalMap;
16
17
 
17
18
  var wrapper = function (get) {
@@ -39,7 +40,7 @@ var methods = {
39
40
  var $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);
40
41
 
41
42
  // IE11 WeakMap frozen keys fix
42
- if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {
43
+ if (NATIVE_WEAK_MAP && IS_IE11) {
43
44
  InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
44
45
  assign(InternalMap.prototype, methods);
45
46
  meta.NEED = true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js",
3
3
  "description": "Standard library",
4
- "version": "2.6.0",
4
+ "version": "2.6.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"