core-js-pure 3.4.3 → 3.4.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,5 +1,6 @@
1
1
  var parent = require('../../es/string');
2
2
  require('../../modules/esnext.string.at');
3
+ require('../../modules/esnext.string.code-points');
3
4
  // TODO: remove from `core-js@4`
4
5
  require('../../modules/esnext.string.match-all');
5
6
  require('../../modules/esnext.string.replace-all');
@@ -1,5 +1,6 @@
1
1
  var parent = require('../../../es/string/virtual');
2
2
  require('../../../modules/esnext.string.at');
3
+ require('../../../modules/esnext.string.code-points');
3
4
  // TODO: remove from `core-js@4`
4
5
  require('../../../modules/esnext.string.match-all');
5
6
  require('../../../modules/esnext.string.replace-all');
@@ -0,0 +1,7 @@
1
+ var shared = require('../internals/shared');
2
+
3
+ var functionToString = Function.toString;
4
+
5
+ module.exports = shared('inspectSource', function (it) {
6
+ return functionToString.call(it);
7
+ });
@@ -1,6 +1,6 @@
1
1
  var global = require('../internals/global');
2
- var nativeFunctionToString = require('../internals/function-to-string');
2
+ var inspectSource = require('../internals/inspect-source');
3
3
 
4
4
  var WeakMap = global.WeakMap;
5
5
 
6
- module.exports = typeof WeakMap === 'function' && /native code/.test(nativeFunctionToString.call(WeakMap));
6
+ module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
@@ -8,11 +8,22 @@ var toObject = require('../internals/to-object');
8
8
  var IndexedObject = require('../internals/indexed-object');
9
9
 
10
10
  var nativeAssign = Object.assign;
11
+ var defineProperty = Object.defineProperty;
11
12
 
12
13
  // `Object.assign` method
13
14
  // https://tc39.github.io/ecma262/#sec-object.assign
14
- // should work with symbols and should have deterministic property order (V8 bug)
15
15
  module.exports = !nativeAssign || fails(function () {
16
+ // should have correct order of operations (Edge bug)
17
+ if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
18
+ enumerable: true,
19
+ get: function () {
20
+ defineProperty(this, 'b', {
21
+ value: 3,
22
+ enumerable: false
23
+ });
24
+ }
25
+ }), { b: 2 })).b !== 1) return true;
26
+ // should work with symbols and should have deterministic property order (V8 bug)
16
27
  var A = {};
17
28
  var B = {};
18
29
  // eslint-disable-next-line no-undef
@@ -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.4.3',
7
+ version: '3.4.7',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -1,12 +1,19 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $filter = require('../internals/array-iteration').filter;
4
+ var fails = require('../internals/fails');
4
5
  var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
5
6
 
7
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
8
+ // Edge 14- issue
9
+ var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
10
+ [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
11
+ });
12
+
6
13
  // `Array.prototype.filter` method
7
14
  // https://tc39.github.io/ecma262/#sec-array.prototype.filter
8
15
  // with adding support of @@species
9
- $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
16
+ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
10
17
  filter: function filter(callbackfn /* , thisArg */) {
11
18
  return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
12
19
  }
@@ -1,12 +1,19 @@
1
1
  'use strict';
2
2
  var $ = require('../internals/export');
3
3
  var $map = require('../internals/array-iteration').map;
4
+ var fails = require('../internals/fails');
4
5
  var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
5
6
 
7
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
8
+ // FF49- issue
9
+ var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
10
+ [].map.call({ length: -1, 0: 1 }, function (it) { throw it; });
11
+ });
12
+
6
13
  // `Array.prototype.map` method
7
14
  // https://tc39.github.io/ecma262/#sec-array.prototype.map
8
15
  // with adding support of @@species
9
- $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, {
16
+ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
10
17
  map: function map(callbackfn /* , thisArg */) {
11
18
  return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
12
19
  }
@@ -2,14 +2,20 @@
2
2
  var $ = require('../internals/export');
3
3
  var IS_PURE = require('../internals/is-pure');
4
4
  var NativePromise = require('../internals/native-promise-constructor');
5
+ var fails = require('../internals/fails');
5
6
  var getBuiltIn = require('../internals/get-built-in');
6
7
  var speciesConstructor = require('../internals/species-constructor');
7
8
  var promiseResolve = require('../internals/promise-resolve');
8
9
  var redefine = require('../internals/redefine');
9
10
 
11
+ // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
12
+ var NON_GENERIC = !!NativePromise && fails(function () {
13
+ NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
14
+ });
15
+
10
16
  // `Promise.prototype.finally` method
11
17
  // https://tc39.github.io/ecma262/#sec-promise.prototype.finally
12
- $({ target: 'Promise', proto: true, real: true }, {
18
+ $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
13
19
  'finally': function (onFinally) {
14
20
  var C = speciesConstructor(this, getBuiltIn('Promise'));
15
21
  var isFunction = typeof onFinally == 'function';
@@ -6,13 +6,13 @@ var getBuiltIn = require('../internals/get-built-in');
6
6
  var NativePromise = require('../internals/native-promise-constructor');
7
7
  var redefine = require('../internals/redefine');
8
8
  var redefineAll = require('../internals/redefine-all');
9
- var shared = require('../internals/shared');
10
9
  var setToStringTag = require('../internals/set-to-string-tag');
11
10
  var setSpecies = require('../internals/set-species');
12
11
  var isObject = require('../internals/is-object');
13
12
  var aFunction = require('../internals/a-function');
14
13
  var anInstance = require('../internals/an-instance');
15
14
  var classof = require('../internals/classof-raw');
15
+ var inspectSource = require('../internals/inspect-source');
16
16
  var iterate = require('../internals/iterate');
17
17
  var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
18
18
  var speciesConstructor = require('../internals/species-constructor');
@@ -36,7 +36,6 @@ var PromiseConstructor = NativePromise;
36
36
  var TypeError = global.TypeError;
37
37
  var document = global.document;
38
38
  var process = global.process;
39
- var inspectSource = shared('inspectSource');
40
39
  var $fetch = getBuiltIn('fetch');
41
40
  var newPromiseCapability = newPromiseCapabilityModule.f;
42
41
  var newGenericPromiseCapability = newPromiseCapability;
@@ -2,6 +2,7 @@ var $ = require('../internals/export');
2
2
  var anObject = require('../internals/an-object');
3
3
  var isObject = require('../internals/is-object');
4
4
  var has = require('../internals/has');
5
+ var fails = require('../internals/fails');
5
6
  var definePropertyModule = require('../internals/object-define-property');
6
7
  var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
7
8
  var getPrototypeOf = require('../internals/object-get-prototype-of');
@@ -31,6 +32,14 @@ function set(target, propertyKey, V /* , receiver */) {
31
32
  return ownDescriptor.set === undefined ? false : (ownDescriptor.set.call(receiver, V), true);
32
33
  }
33
34
 
34
- $({ target: 'Reflect', stat: true }, {
35
+ // MS Edge 17-18 Reflect.set allows setting the property to object
36
+ // with non-writable property on the prototype
37
+ var MS_EDGE_BUG = fails(function () {
38
+ var object = definePropertyModule.f({}, 'a', { configurable: true });
39
+ // eslint-disable-next-line no-undef
40
+ return Reflect.set(getPrototypeOf(object), 'a', 1, object) !== false;
41
+ });
42
+
43
+ $({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {
35
44
  set: set
36
45
  });
@@ -4,6 +4,7 @@ var $ = require('../internals/export');
4
4
  var global = require('../internals/global');
5
5
  var anInstance = require('../internals/an-instance');
6
6
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
7
+ var fails = require('../internals/fails');
7
8
  var has = require('../internals/has');
8
9
  var wellKnownSymbol = require('../internals/well-known-symbol');
9
10
  var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
@@ -15,7 +16,11 @@ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
15
16
  var NativeIterator = global.Iterator;
16
17
 
17
18
  // FF56- have non-standard global helper `Iterator`
18
- var FORCED = IS_PURE || typeof NativeIterator != 'function' || NativeIterator.prototype !== IteratorPrototype;
19
+ var FORCED = IS_PURE
20
+ || typeof NativeIterator != 'function'
21
+ || NativeIterator.prototype !== IteratorPrototype
22
+ // FF44- non-standard `Iterator` passes previous tests
23
+ || !fails(function () { NativeIterator({}); });
19
24
 
20
25
  var IteratorConstructor = function Iterator() {
21
26
  anInstance(this, IteratorConstructor);
@@ -32,7 +37,7 @@ if (!has(IteratorPrototype, TO_STRING_TAG)) {
32
37
  createNonEnumerableProperty(IteratorPrototype, TO_STRING_TAG, 'Iterator');
33
38
  }
34
39
 
35
- if (!has(IteratorPrototype, 'constructor') || IteratorPrototype.constructor === Object) {
40
+ if (FORCED || !has(IteratorPrototype, 'constructor') || IteratorPrototype.constructor === Object) {
36
41
  createNonEnumerableProperty(IteratorPrototype, 'constructor', IteratorConstructor);
37
42
  }
38
43
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
3
  "description": "Standard library",
4
- "version": "3.4.3",
4
+ "version": "3.4.7",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
package/postinstall.js CHANGED
@@ -5,12 +5,19 @@ var path = require('path');
5
5
  var env = process.env;
6
6
 
7
7
  var ADBLOCK = is(env.ADBLOCK);
8
- var CI = is(env.CI);
9
8
  var COLOR = is(env.npm_config_color);
10
9
  var DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE);
11
10
  var SILENT = ['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel) !== -1;
12
11
  var MINUTE = 60 * 1000;
13
12
 
13
+ // you could add a PR with an env variable for your CI detection
14
+ var CI = [
15
+ 'BUILD_NUMBER',
16
+ 'CI',
17
+ 'CONTINUOUS_INTEGRATION',
18
+ 'RUN_ID'
19
+ ].some(function (it) { return is(env[it]); });
20
+
14
21
  var BANNER = '\u001B[96mThank you for using core-js (\u001B[94m https://github.com/zloirock/core-js \u001B[96m) for polyfilling JavaScript standard library!\u001B[0m\n\n' +
15
22
  '\u001B[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: \u001B[0m\n' +
16
23
  '\u001B[96m>\u001B[94m https://opencollective.com/core-js \u001B[0m\n' +
@@ -1,3 +0,0 @@
1
- var shared = require('../internals/shared');
2
-
3
- module.exports = shared('native-function-to-string', Function.toString);