core-js 3.11.1 → 3.11.2

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.
@@ -0,0 +1 @@
1
+ module.exports = typeof window == 'object';
@@ -47,6 +47,8 @@ if (!queueMicrotask) {
47
47
  } else if (Promise && Promise.resolve) {
48
48
  // Promise.resolve without an argument throws an error in LG WebOS 2
49
49
  promise = Promise.resolve(undefined);
50
+ // workaround of WebKit ~ iOS Safari 10.1 bug
51
+ promise.constructor = Promise;
50
52
  then = promise.then;
51
53
  notify = function () {
52
54
  then.call(promise, flush);
@@ -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.11.1',
7
+ version: '3.11.2',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -25,6 +25,7 @@ var perform = require('../internals/perform');
25
25
  var InternalStateModule = require('../internals/internal-state');
26
26
  var isForced = require('../internals/is-forced');
27
27
  var wellKnownSymbol = require('../internals/well-known-symbol');
28
+ var IS_BROWSER = require('../internals/engine-is-browser');
28
29
  var IS_NODE = require('../internals/engine-is-node');
29
30
  var V8_VERSION = require('../internals/engine-v8-version');
30
31
 
@@ -49,18 +50,15 @@ var FULFILLED = 1;
49
50
  var REJECTED = 2;
50
51
  var HANDLED = 1;
51
52
  var UNHANDLED = 2;
53
+ var SUBCLASSING = false;
52
54
  var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
53
55
 
54
56
  var FORCED = isForced(PROMISE, function () {
55
57
  var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
56
- if (!GLOBAL_CORE_JS_PROMISE) {
57
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
58
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
59
- // We can't detect it synchronously, so just check versions
60
- if (V8_VERSION === 66) return true;
61
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
62
- if (!IS_NODE && !NATIVE_REJECTION_EVENT) return true;
63
- }
58
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
59
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
60
+ // We can't detect it synchronously, so just check versions
61
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
64
62
  // We need Promise#finally in the pure version for preventing prototype pollution
65
63
  if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
66
64
  // We can't use @@species feature detection in V8 since it causes
@@ -68,13 +66,16 @@ var FORCED = isForced(PROMISE, function () {
68
66
  // https://github.com/zloirock/core-js/issues/679
69
67
  if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
70
68
  // Detect correctness of subclassing with @@species support
71
- var promise = PromiseConstructor.resolve(1);
69
+ var promise = new PromiseConstructor(function (resolve) { resolve(1); });
72
70
  var FakePromise = function (exec) {
73
71
  exec(function () { /* empty */ }, function () { /* empty */ });
74
72
  };
75
73
  var constructor = promise.constructor = {};
76
74
  constructor[SPECIES] = FakePromise;
77
- return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
75
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
76
+ if (!SUBCLASSING) return true;
77
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
78
+ return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;
78
79
  });
79
80
 
80
81
  var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
@@ -288,7 +289,7 @@ if (FORCED) {
288
289
  nativeThen = NativePromisePrototype.then;
289
290
 
290
291
  // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
291
- redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
292
+ if (!SUBCLASSING) redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
292
293
  var that = this;
293
294
  return new PromiseConstructor(function (resolve, reject) {
294
295
  nativeThen.call(that, resolve, reject);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js",
3
3
  "description": "Standard library",
4
- "version": "3.11.1",
4
+ "version": "3.11.2",
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": "1e9c4fbb22c7954d50a4db09d40d5c7648bead88"
58
+ "gitHead": "040f7836ad467dae5a0b849b02442a3ed2607b18"
59
59
  }