core-js 2.6.3 → 2.6.7

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.3' };
1
+ var core = module.exports = { version: '2.6.7' };
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));
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  // 19.1.2.1 Object.assign(target, source, ...)
3
+ var DESCRIPTORS = require('./_descriptors');
3
4
  var getKeys = require('./_object-keys');
4
5
  var gOPS = require('./_object-gops');
5
6
  var pIE = require('./_object-pie');
@@ -29,6 +30,9 @@ module.exports = !$assign || require('./_fails')(function () {
29
30
  var length = keys.length;
30
31
  var j = 0;
31
32
  var key;
32
- while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
33
+ while (length > j) {
34
+ key = keys[j++];
35
+ if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
36
+ }
33
37
  } return T;
34
38
  } : $assign;
@@ -1,3 +1,4 @@
1
+ var DESCRIPTORS = require('./_descriptors');
1
2
  var getKeys = require('./_object-keys');
2
3
  var toIObject = require('./_to-iobject');
3
4
  var isEnum = require('./_object-pie').f;
@@ -9,8 +10,12 @@ module.exports = function (isEntries) {
9
10
  var i = 0;
10
11
  var result = [];
11
12
  var key;
12
- while (length > i) if (isEnum.call(O, key = keys[i++])) {
13
- result.push(isEntries ? [key, O[key]] : O[key]);
14
- } return result;
13
+ while (length > i) {
14
+ key = keys[i++];
15
+ if (!DESCRIPTORS || isEnum.call(O, key)) {
16
+ result.push(isEntries ? [key, O[key]] : O[key]);
17
+ }
18
+ }
19
+ return result;
15
20
  };
16
21
  };
@@ -17,12 +17,14 @@ var enumKeys = require('./_enum-keys');
17
17
  var isArray = require('./_is-array');
18
18
  var anObject = require('./_an-object');
19
19
  var isObject = require('./_is-object');
20
+ var toObject = require('./_to-object');
20
21
  var toIObject = require('./_to-iobject');
21
22
  var toPrimitive = require('./_to-primitive');
22
23
  var createDesc = require('./_property-desc');
23
24
  var _create = require('./_object-create');
24
25
  var gOPNExt = require('./_object-gopn-ext');
25
26
  var $GOPD = require('./_object-gopd');
27
+ var $GOPS = require('./_object-gops');
26
28
  var $DP = require('./_object-dp');
27
29
  var $keys = require('./_object-keys');
28
30
  var gOPD = $GOPD.f;
@@ -39,7 +41,7 @@ var SymbolRegistry = shared('symbol-registry');
39
41
  var AllSymbols = shared('symbols');
40
42
  var OPSymbols = shared('op-symbols');
41
43
  var ObjectProto = Object[PROTOTYPE];
42
- var USE_NATIVE = typeof $Symbol == 'function';
44
+ var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
43
45
  var QObject = global.QObject;
44
46
  // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
45
47
  var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
@@ -149,7 +151,7 @@ if (!USE_NATIVE) {
149
151
  $DP.f = $defineProperty;
150
152
  require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;
151
153
  require('./_object-pie').f = $propertyIsEnumerable;
152
- require('./_object-gops').f = $getOwnPropertySymbols;
154
+ $GOPS.f = $getOwnPropertySymbols;
153
155
 
154
156
  if (DESCRIPTORS && !require('./_library')) {
155
157
  redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
@@ -200,6 +202,16 @@ $export($export.S + $export.F * !USE_NATIVE, 'Object', {
200
202
  getOwnPropertySymbols: $getOwnPropertySymbols
201
203
  });
202
204
 
205
+ // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
206
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3443
207
+ var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
208
+
209
+ $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
210
+ getOwnPropertySymbols: function getOwnPropertySymbols(it) {
211
+ return $GOPS.f(toObject(it));
212
+ }
213
+ });
214
+
203
215
  // 24.3.2 JSON.stringify(value [, replacer [, space]])
204
216
  $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
205
217
  var S = $Symbol();
@@ -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;
@@ -5,7 +5,9 @@ var $pad = require('./_string-pad');
5
5
  var userAgent = require('./_user-agent');
6
6
 
7
7
  // https://github.com/zloirock/core-js/issues/280
8
- $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
8
+ var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
9
+
10
+ $export($export.P + $export.F * WEBKIT_BUG, 'String', {
9
11
  padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
10
12
  return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
11
13
  }
@@ -5,7 +5,9 @@ var $pad = require('./_string-pad');
5
5
  var userAgent = require('./_user-agent');
6
6
 
7
7
  // https://github.com/zloirock/core-js/issues/280
8
- $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
8
+ var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
9
+
10
+ $export($export.P + $export.F * WEBKIT_BUG, 'String', {
9
11
  padStart: function padStart(maxLength /* , fillString = ' ' */) {
10
12
  return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
11
13
  }
package/modules/_core.js CHANGED
@@ -1,2 +1,2 @@
1
- var core = module.exports = { version: '2.6.3' };
1
+ var core = module.exports = { version: '2.6.7' };
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));
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
  // 19.1.2.1 Object.assign(target, source, ...)
3
+ var DESCRIPTORS = require('./_descriptors');
3
4
  var getKeys = require('./_object-keys');
4
5
  var gOPS = require('./_object-gops');
5
6
  var pIE = require('./_object-pie');
@@ -29,6 +30,9 @@ module.exports = !$assign || require('./_fails')(function () {
29
30
  var length = keys.length;
30
31
  var j = 0;
31
32
  var key;
32
- while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
33
+ while (length > j) {
34
+ key = keys[j++];
35
+ if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
36
+ }
33
37
  } return T;
34
38
  } : $assign;
@@ -1,3 +1,4 @@
1
+ var DESCRIPTORS = require('./_descriptors');
1
2
  var getKeys = require('./_object-keys');
2
3
  var toIObject = require('./_to-iobject');
3
4
  var isEnum = require('./_object-pie').f;
@@ -9,8 +10,12 @@ module.exports = function (isEntries) {
9
10
  var i = 0;
10
11
  var result = [];
11
12
  var key;
12
- while (length > i) if (isEnum.call(O, key = keys[i++])) {
13
- result.push(isEntries ? [key, O[key]] : O[key]);
14
- } return result;
13
+ while (length > i) {
14
+ key = keys[i++];
15
+ if (!DESCRIPTORS || isEnum.call(O, key)) {
16
+ result.push(isEntries ? [key, O[key]] : O[key]);
17
+ }
18
+ }
19
+ return result;
15
20
  };
16
21
  };
@@ -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) {
@@ -17,12 +17,14 @@ var enumKeys = require('./_enum-keys');
17
17
  var isArray = require('./_is-array');
18
18
  var anObject = require('./_an-object');
19
19
  var isObject = require('./_is-object');
20
+ var toObject = require('./_to-object');
20
21
  var toIObject = require('./_to-iobject');
21
22
  var toPrimitive = require('./_to-primitive');
22
23
  var createDesc = require('./_property-desc');
23
24
  var _create = require('./_object-create');
24
25
  var gOPNExt = require('./_object-gopn-ext');
25
26
  var $GOPD = require('./_object-gopd');
27
+ var $GOPS = require('./_object-gops');
26
28
  var $DP = require('./_object-dp');
27
29
  var $keys = require('./_object-keys');
28
30
  var gOPD = $GOPD.f;
@@ -39,7 +41,7 @@ var SymbolRegistry = shared('symbol-registry');
39
41
  var AllSymbols = shared('symbols');
40
42
  var OPSymbols = shared('op-symbols');
41
43
  var ObjectProto = Object[PROTOTYPE];
42
- var USE_NATIVE = typeof $Symbol == 'function';
44
+ var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
43
45
  var QObject = global.QObject;
44
46
  // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
45
47
  var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
@@ -149,7 +151,7 @@ if (!USE_NATIVE) {
149
151
  $DP.f = $defineProperty;
150
152
  require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;
151
153
  require('./_object-pie').f = $propertyIsEnumerable;
152
- require('./_object-gops').f = $getOwnPropertySymbols;
154
+ $GOPS.f = $getOwnPropertySymbols;
153
155
 
154
156
  if (DESCRIPTORS && !require('./_library')) {
155
157
  redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
@@ -200,6 +202,16 @@ $export($export.S + $export.F * !USE_NATIVE, 'Object', {
200
202
  getOwnPropertySymbols: $getOwnPropertySymbols
201
203
  });
202
204
 
205
+ // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
206
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3443
207
+ var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
208
+
209
+ $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
210
+ getOwnPropertySymbols: function getOwnPropertySymbols(it) {
211
+ return $GOPS.f(toObject(it));
212
+ }
213
+ });
214
+
203
215
  // 24.3.2 JSON.stringify(value [, replacer [, space]])
204
216
  $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
205
217
  var S = $Symbol();
@@ -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;
@@ -5,7 +5,9 @@ var $pad = require('./_string-pad');
5
5
  var userAgent = require('./_user-agent');
6
6
 
7
7
  // https://github.com/zloirock/core-js/issues/280
8
- $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
8
+ var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
9
+
10
+ $export($export.P + $export.F * WEBKIT_BUG, 'String', {
9
11
  padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
10
12
  return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
11
13
  }
@@ -5,7 +5,9 @@ var $pad = require('./_string-pad');
5
5
  var userAgent = require('./_user-agent');
6
6
 
7
7
  // https://github.com/zloirock/core-js/issues/280
8
- $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
8
+ var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
9
+
10
+ $export($export.P + $export.F * WEBKIT_BUG, 'String', {
9
11
  padStart: function padStart(maxLength /* , fillString = ' ' */) {
10
12
  return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
11
13
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js",
3
3
  "description": "Standard library",
4
- "version": "2.6.3",
4
+ "version": "2.6.7",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
@@ -37,7 +37,8 @@
37
37
  "lint": "eslint ./",
38
38
  "promises-tests": "promises-aplus-tests tests/promises-aplus/adapter",
39
39
  "observables-tests": "node tests/observables/adapter && node tests/observables/adapter-library",
40
- "test": "npm run grunt clean copy && npm run lint && npm run grunt livescript client karma:default && npm run grunt library karma:library && npm run promises-tests && npm run observables-tests && lsc tests/commonjs"
40
+ "test": "npm run grunt clean copy && npm run lint && npm run grunt livescript client karma:default && npm run grunt library karma:library && npm run promises-tests && npm run observables-tests && lsc tests/commonjs",
41
+ "postinstall": "node scripts/postinstall"
41
42
  },
42
43
  "license": "MIT",
43
44
  "keywords": [
@@ -0,0 +1,12 @@
1
+ /* eslint-disable no-console,max-len */
2
+ var env = process.env;
3
+ var CI = !!env.CI && env.CI !== '0' && env.CI !== 'false';
4
+ var SILENT = !!~['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel);
5
+
6
+ if (!CI && !SILENT) {
7
+ console.log('\u001B[96mThank you for using core-js (\u001B[94m https://github.com/zloirock/core-js \u001B[96m)!\u001B[0m\n');
8
+ console.log('\u001B[96mPlease consider supporting of core-js on Open Collective or Patreon: \u001B[0m');
9
+ console.log('\u001B[96m>\u001B[94m https://opencollective.com/core-js \u001B[0m');
10
+ console.log('\u001B[96m>\u001B[94m https://www.patreon.com/zloirock \u001B[0m\n');
11
+ console.log('\u001B[96mAlso, the author of core-js (\u001B[94m https://github.com/zloirock \u001B[96m) is looking for a good job -)\u001B[0m\n');
12
+ }