core-js-pure 3.22.4 → 3.22.5

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.
@@ -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.22.4',
7
+ version: '3.22.5',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
10
- license: 'https://github.com/zloirock/core-js/blob/v3.22.4/LICENSE',
10
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE',
11
11
  source: 'https://github.com/zloirock/core-js'
12
12
  });
@@ -13,7 +13,7 @@ var FORCED = !fails(function () {
13
13
  });
14
14
 
15
15
  // https://github.com/tc39/proposal-error-cause
16
- $({ global: true, arity: 2, forced: FORCED }, {
16
+ $({ global: true, constructor: true, arity: 2, forced: FORCED }, {
17
17
  AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) {
18
18
  // eslint-disable-next-line no-unused-vars -- required for functions `.length`
19
19
  return function AggregateError(errors, message) { return apply(init, this, arguments); };
@@ -49,6 +49,6 @@ var AggregateErrorPrototype = $AggregateError.prototype = create(Error.prototype
49
49
 
50
50
  // `AggregateError` constructor
51
51
  // https://tc39.es/ecma262/#sec-aggregate-error-constructor
52
- $({ global: true }, {
52
+ $({ global: true, constructor: true, arity: 2 }, {
53
53
  AggregateError: $AggregateError
54
54
  });
@@ -4,6 +4,6 @@ var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-native');
4
4
 
5
5
  // `DataView` constructor
6
6
  // https://tc39.es/ecma262/#sec-dataview-constructor
7
- $({ global: true, forced: !NATIVE_ARRAY_BUFFER }, {
7
+ $({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, {
8
8
  DataView: ArrayBufferModule.DataView
9
9
  });
@@ -12,14 +12,14 @@ var FORCED = Error('e', { cause: 7 }).cause !== 7;
12
12
  var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
13
13
  var O = {};
14
14
  O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
15
- $({ global: true, arity: 1, forced: FORCED }, O);
15
+ $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
16
16
  };
17
17
 
18
18
  var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
19
19
  if (WebAssembly && WebAssembly[ERROR_NAME]) {
20
20
  var O = {};
21
21
  O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
22
- $({ target: WEB_ASSEMBLY, stat: true, arity: 1, forced: FORCED }, O);
22
+ $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
23
23
  }
24
24
  };
25
25
 
@@ -280,7 +280,7 @@ if (FORCED_PROMISE_CONSTRUCTOR) {
280
280
  }
281
281
  }
282
282
 
283
- $({ global: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
283
+ $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
284
284
  Promise: PromiseConstructor
285
285
  });
286
286
 
@@ -207,7 +207,7 @@ if (!NATIVE_SYMBOL) {
207
207
  }
208
208
  }
209
209
 
210
- $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
210
+ $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
211
211
  Symbol: $Symbol
212
212
  });
213
213
 
@@ -24,6 +24,6 @@ if (IS_PURE || !hasOwn(AsyncIteratorPrototype, 'constructor') || AsyncIteratorPr
24
24
  createNonEnumerableProperty(AsyncIteratorPrototype, 'constructor', AsyncIteratorConstructor);
25
25
  }
26
26
 
27
- $({ global: true, forced: IS_PURE }, {
27
+ $({ global: true, constructor: true, forced: IS_PURE }, {
28
28
  AsyncIterator: AsyncIteratorConstructor
29
29
  });
@@ -36,6 +36,6 @@ if (FORCED || !hasOwn(IteratorPrototype, 'constructor') || IteratorPrototype.con
36
36
 
37
37
  IteratorConstructor.prototype = IteratorPrototype;
38
38
 
39
- $({ global: true, forced: FORCED }, {
39
+ $({ global: true, constructor: true, forced: FORCED }, {
40
40
  Iterator: IteratorConstructor
41
41
  });
@@ -180,7 +180,7 @@ defineBuiltIns(ObservablePrototype, {
180
180
 
181
181
  defineBuiltIn(ObservablePrototype, $$OBSERVABLE, function () { return this; });
182
182
 
183
- $({ global: true, forced: OBSERVABLE_FORCED }, {
183
+ $({ global: true, constructor: true, forced: OBSERVABLE_FORCED }, {
184
184
  Observable: $Observable
185
185
  });
186
186
 
@@ -111,7 +111,7 @@ var FORCED_CONSTRUCTOR = IS_PURE ? INCORRECT_TO_STRING || INCORRECT_CODE || MISS
111
111
 
112
112
  // `DOMException` constructor
113
113
  // https://webidl.spec.whatwg.org/#idl-DOMException
114
- $({ global: true, forced: FORCED_CONSTRUCTOR }, {
114
+ $({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR }, {
115
115
  DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
116
116
  });
117
117
 
@@ -36,7 +36,7 @@ var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !DOM_EXCEPTION_HAS_STACK;
36
36
 
37
37
  // `DOMException` constructor patch for `.stack` where it's required
38
38
  // https://webidl.spec.whatwg.org/#es-DOMException-specialness
39
- $({ global: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic
39
+ $({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic
40
40
  DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
41
41
  });
42
42
 
@@ -61,30 +61,42 @@ var checkBasicSemantic = function (structuredCloneImplementation) {
61
61
  }) && structuredCloneImplementation;
62
62
  };
63
63
 
64
+ var checkErrorsCloning = function (structuredCloneImplementation) {
65
+ return !fails(function () {
66
+ var error = new Error();
67
+ var test = structuredCloneImplementation({ a: error, b: error });
68
+ return !(test && test.a === test.b && test.a instanceof Error);
69
+ });
70
+ };
71
+
64
72
  // https://github.com/whatwg/html/pull/5749
65
- var checkNewErrorsSemantic = function (structuredCloneImplementation) {
73
+ var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) {
66
74
  return !fails(function () {
67
75
  var test = structuredCloneImplementation(new global.AggregateError([1], PERFORMANCE_MARK, { cause: 3 }));
68
76
  return test.name != 'AggregateError' || test.errors[0] != 1 || test.message != PERFORMANCE_MARK || test.cause != 3;
69
- }) && structuredCloneImplementation;
77
+ });
70
78
  };
71
79
 
72
- // FF94+, Safari TP134+, Chrome Canary 98+, NodeJS 17.0+, Deno 1.13+
73
- // current FF and Safari implementations can't clone errors
80
+ // FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+
81
+ // FF and Safari implementations can't clone errors
74
82
  // https://bugzilla.mozilla.org/show_bug.cgi?id=1556604
83
+ // Chrome <103 returns `null` if cloned object contains multiple references to one error
84
+ // https://bugs.chromium.org/p/v8/issues/detail?id=12542
75
85
  // no one of current implementations supports new (html/5749) error cloning semantic
76
86
  var nativeStructuredClone = global.structuredClone;
77
87
 
78
- var FORCED_REPLACEMENT = IS_PURE || !checkNewErrorsSemantic(nativeStructuredClone);
88
+ var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone) || !checkNewErrorsCloningSemantic(nativeStructuredClone);
79
89
 
80
90
  // Chrome 82+, Safari 14.1+, Deno 1.11+
81
91
  // Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException`
92
+ // Chrome returns `null` if cloned object contains multiple references to one error
82
93
  // Safari 14.1 implementation doesn't clone some `RegExp` flags, so requires a workaround
83
- // current Safari implementation can't clone errors
94
+ // Safari implementation can't clone errors
84
95
  // Deno 1.2-1.10 implementations too naive
85
- // NodeJS 16.0+ does not have `PerformanceMark` constructor, structured cloning implementation
86
- // from `performance.mark` is too naive and can't clone, for example, `RegExp` or some boxed primitives
87
- // https://github.com/nodejs/node/issues/40840
96
+ // NodeJS 16.0+ does not have `PerformanceMark` constructor
97
+ // NodeJS <17.2 structured cloning implementation from `performance.mark` is too naive
98
+ // and can't clone, for example, `RegExp` or some boxed primitives
99
+ // https://github.com/nodejs/node/issues/40840
88
100
  // no one of current implementations supports new (html/5749) error cloning semantic
89
101
  var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) {
90
102
  return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail;
@@ -337,7 +337,7 @@ defineBuiltIn(URLSearchParamsPrototype, 'toString', function toString() {
337
337
 
338
338
  setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
339
339
 
340
- $({ global: true, forced: !USE_NATIVE_URL }, {
340
+ $({ global: true, constructor: true, forced: !USE_NATIVE_URL }, {
341
341
  URLSearchParams: URLSearchParamsConstructor
342
342
  });
343
343
 
@@ -380,7 +380,7 @@ if (!USE_NATIVE_URL && isCallable(Headers)) {
380
380
  RequestPrototype.constructor = RequestConstructor;
381
381
  RequestConstructor.prototype = RequestPrototype;
382
382
 
383
- $({ global: true, forced: true, noTargetGet: true }, {
383
+ $({ global: true, constructor: true, noTargetGet: true, forced: true }, {
384
384
  Request: RequestConstructor
385
385
  });
386
386
  }
@@ -1037,6 +1037,6 @@ if (NativeURL) {
1037
1037
 
1038
1038
  setToStringTag(URLConstructor, 'URL');
1039
1039
 
1040
- $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
1040
+ $({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
1041
1041
  URL: URLConstructor
1042
1042
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
3
  "description": "Standard library",
4
- "version": "3.22.4",
4
+ "version": "3.22.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
@@ -53,6 +53,5 @@
53
53
  ],
54
54
  "scripts": {
55
55
  "postinstall": "node -e \"try{require('./postinstall')}catch(e){}\""
56
- },
57
- "gitHead": "6ba79a5aada7286aa44ca9e4029cbb74dd84ffd6"
56
+ }
58
57
  }