core-js-pure 3.30.0 → 3.30.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.
@@ -11,4 +11,4 @@ module.exports =
11
11
  check(typeof self == 'object' && self) ||
12
12
  check(typeof global == 'object' && global) ||
13
13
  // eslint-disable-next-line no-new-func -- fallback
14
- (function () { return this; })() || Function('return this')();
14
+ (function () { return this; })() || this || Function('return this')();
@@ -4,9 +4,9 @@ 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.30.0',
7
+ version: '3.30.2',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
10
- license: 'https://github.com/zloirock/core-js/blob/v3.30.0/LICENSE',
10
+ license: 'https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE',
11
11
  source: 'https://github.com/zloirock/core-js'
12
12
  });
@@ -1,13 +1,18 @@
1
1
  /* eslint-disable es/no-symbol -- required for testing */
2
2
  var V8_VERSION = require('../internals/engine-v8-version');
3
3
  var fails = require('../internals/fails');
4
+ var global = require('../internals/global');
5
+
6
+ var $String = global.String;
4
7
 
5
8
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
6
9
  module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
7
10
  var symbol = Symbol();
8
11
  // Chrome 38 Symbol has incorrect toString conversion
9
12
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
10
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
13
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
14
+ // of course, fail.
15
+ return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
11
16
  // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
12
17
  !Symbol.sham && V8_VERSION && V8_VERSION < 41;
13
18
  });
@@ -125,6 +125,11 @@ var throwUnpolyfillable = function (type, action) {
125
125
  throw new DOMException((action || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR);
126
126
  };
127
127
 
128
+ var tryNativeRestrictedStructuredClone = function (value, type) {
129
+ if (!nativeRestrictedStructuredClone) throwUnpolyfillable(type);
130
+ return nativeRestrictedStructuredClone(value);
131
+ };
132
+
128
133
  var createDataTransfer = function () {
129
134
  var dataTransfer;
130
135
  try {
@@ -245,11 +250,20 @@ var structuredCloneInternal = function (value, map) {
245
250
  structuredCloneInternal(value.p4, map)
246
251
  );
247
252
  } catch (error) {
248
- if (nativeRestrictedStructuredClone) {
249
- cloned = nativeRestrictedStructuredClone(value);
250
- } else throwUnpolyfillable(type);
253
+ cloned = tryNativeRestrictedStructuredClone(value, type);
251
254
  }
252
255
  break;
256
+ case 'File':
257
+ if (nativeRestrictedStructuredClone) try {
258
+ cloned = nativeRestrictedStructuredClone(value);
259
+ // NodeJS 20.0.0 bug, https://github.com/nodejs/node/issues/47612
260
+ if (classof(cloned) !== type) cloned = undefined;
261
+ } catch (error) { /* empty */ }
262
+ if (!cloned) try {
263
+ cloned = new File([value], value.name, value);
264
+ } catch (error) { /* empty */ }
265
+ if (!cloned) throwUnpolyfillable(type);
266
+ break;
253
267
  case 'FileList':
254
268
  dataTransfer = createDataTransfer();
255
269
  if (dataTransfer) {
@@ -257,9 +271,7 @@ var structuredCloneInternal = function (value, map) {
257
271
  dataTransfer.items.add(structuredCloneInternal(value[i], map));
258
272
  }
259
273
  cloned = dataTransfer.files;
260
- } else if (nativeRestrictedStructuredClone) {
261
- cloned = nativeRestrictedStructuredClone(value);
262
- } else throwUnpolyfillable(type);
274
+ } else cloned = tryNativeRestrictedStructuredClone(value, type);
263
275
  break;
264
276
  case 'ImageData':
265
277
  // Safari 9 ImageData is a constructor, but typeof ImageData is 'object'
@@ -271,9 +283,7 @@ var structuredCloneInternal = function (value, map) {
271
283
  { colorSpace: value.colorSpace }
272
284
  );
273
285
  } catch (error) {
274
- if (nativeRestrictedStructuredClone) {
275
- cloned = nativeRestrictedStructuredClone(value);
276
- } else throwUnpolyfillable(type);
286
+ cloned = tryNativeRestrictedStructuredClone(value, type);
277
287
  } break;
278
288
  default:
279
289
  if (nativeRestrictedStructuredClone) {
@@ -365,12 +375,6 @@ var structuredCloneInternal = function (value, map) {
365
375
  } catch (error) {
366
376
  throwUncloneable(type);
367
377
  } break;
368
- case 'File':
369
- try {
370
- cloned = new File([value], value.name, value);
371
- } catch (error) {
372
- throwUnpolyfillable(type);
373
- } break;
374
378
  case 'CropTarget':
375
379
  case 'CryptoKey':
376
380
  case 'FileSystemDirectoryHandle':
@@ -1,13 +1,21 @@
1
1
  var $ = require('../internals/export');
2
2
  var getBuiltIn = require('../internals/get-built-in');
3
+ var fails = require('../internals/fails');
3
4
  var validateArgumentsLength = require('../internals/validate-arguments-length');
4
5
  var toString = require('../internals/to-string');
6
+ var USE_NATIVE_URL = require('../internals/url-constructor-detection');
5
7
 
6
8
  var URL = getBuiltIn('URL');
7
9
 
10
+ // https://github.com/nodejs/node/issues/47505
11
+ // https://github.com/denoland/deno/issues/18893
12
+ var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function () {
13
+ URL.canParse();
14
+ });
15
+
8
16
  // `URL.canParse` method
9
17
  // https://url.spec.whatwg.org/#dom-url-canparse
10
- $({ target: 'URL', stat: true }, {
18
+ $({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS }, {
11
19
  canParse: function canParse(url) {
12
20
  var length = validateArgumentsLength(arguments.length, 1);
13
21
  var urlString = toString(url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
- "version": "3.30.0",
3
+ "version": "3.30.2",
4
4
  "description": "Standard library",
5
5
  "keywords": [
6
6
  "ES3",