core-js-pure 3.3.4 → 3.4.1
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.
- package/es/global-this.js +1 -1
- package/es/json/stringify.js +6 -3
- package/features/global-this.js +3 -0
- package/features/map/index.js +1 -1
- package/features/math/index.js +4 -3
- package/features/symbol/index.js +1 -0
- package/features/symbol/replace-all.js +1 -0
- package/internals/is-ios.js +3 -0
- package/internals/microtask.js +2 -2
- package/internals/shared.js +1 -1
- package/internals/task.js +2 -2
- package/internals/typed-arrays-constructors-requires-wrappers.js +1 -1
- package/internals/v8-version.js +5 -2
- package/modules/es.array.concat.js +5 -1
- package/modules/es.array.reverse.js +1 -0
- package/modules/es.array.sort.js +2 -2
- package/modules/es.json.stringify.js +32 -0
- package/modules/es.promise.js +21 -12
- package/modules/es.symbol.js +31 -26
- package/modules/esnext.aggregate-error.js +1 -9
- package/modules/esnext.async-iterator.constructor.js +4 -0
- package/modules/esnext.async-iterator.flat-map.js +4 -4
- package/modules/esnext.iterator.constructor.js +4 -0
- package/modules/esnext.iterator.flat-map.js +7 -6
- package/modules/esnext.math.iaddh.js +1 -0
- package/modules/esnext.math.imulh.js +1 -0
- package/modules/esnext.math.isubh.js +1 -0
- package/modules/esnext.math.signbit.js +1 -1
- package/modules/esnext.math.umulh.js +1 -0
- package/modules/esnext.string.replace-all.js +5 -3
- package/modules/web.url-search-params.js +1 -1
- package/package.json +7 -1
package/es/global-this.js
CHANGED
package/es/json/stringify.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
require('../../modules/es.json.stringify');
|
|
1
2
|
var core = require('../../internals/path');
|
|
2
|
-
var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
if (!core.JSON) core.JSON = { stringify: JSON.stringify };
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line no-unused-vars
|
|
7
|
+
module.exports = function stringify(it, replacer, space) {
|
|
8
|
+
return core.JSON.stringify.apply(null, arguments);
|
|
6
9
|
};
|
package/features/global-this.js
CHANGED
package/features/map/index.js
CHANGED
|
@@ -17,6 +17,6 @@ require('../../modules/esnext.map.merge');
|
|
|
17
17
|
require('../../modules/esnext.map.reduce');
|
|
18
18
|
require('../../modules/esnext.map.some');
|
|
19
19
|
require('../../modules/esnext.map.update');
|
|
20
|
+
require('../../modules/esnext.map.upsert');
|
|
20
21
|
// TODO: remove from `core-js@4`
|
|
21
22
|
require('../../modules/esnext.map.update-or-insert');
|
|
22
|
-
require('../../modules/esnext.map.upsert');
|
package/features/math/index.js
CHANGED
|
@@ -4,12 +4,13 @@ require('../../modules/esnext.math.clamp');
|
|
|
4
4
|
require('../../modules/esnext.math.deg-per-rad');
|
|
5
5
|
require('../../modules/esnext.math.degrees');
|
|
6
6
|
require('../../modules/esnext.math.fscale');
|
|
7
|
-
require('../../modules/esnext.math.iaddh');
|
|
8
|
-
require('../../modules/esnext.math.isubh');
|
|
9
|
-
require('../../modules/esnext.math.imulh');
|
|
10
7
|
require('../../modules/esnext.math.rad-per-deg');
|
|
11
8
|
require('../../modules/esnext.math.radians');
|
|
12
9
|
require('../../modules/esnext.math.scale');
|
|
13
10
|
require('../../modules/esnext.math.seeded-prng');
|
|
14
11
|
require('../../modules/esnext.math.signbit');
|
|
12
|
+
// TODO: Remove from `core-js@4`
|
|
13
|
+
require('../../modules/esnext.math.iaddh');
|
|
14
|
+
require('../../modules/esnext.math.isubh');
|
|
15
|
+
require('../../modules/esnext.math.imulh');
|
|
15
16
|
require('../../modules/esnext.math.umulh');
|
package/features/symbol/index.js
CHANGED
|
@@ -4,4 +4,5 @@ require('../../modules/esnext.symbol.async-dispose');
|
|
|
4
4
|
require('../../modules/esnext.symbol.dispose');
|
|
5
5
|
require('../../modules/esnext.symbol.observable');
|
|
6
6
|
require('../../modules/esnext.symbol.pattern-match');
|
|
7
|
+
// TODO: Remove from `core-js@4`
|
|
7
8
|
require('../../modules/esnext.symbol.replace-all');
|
package/internals/microtask.js
CHANGED
|
@@ -2,7 +2,7 @@ var global = require('../internals/global');
|
|
|
2
2
|
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
|
|
3
3
|
var classof = require('../internals/classof-raw');
|
|
4
4
|
var macrotask = require('../internals/task').set;
|
|
5
|
-
var
|
|
5
|
+
var IS_IOS = require('../internals/is-ios');
|
|
6
6
|
|
|
7
7
|
var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
|
|
8
8
|
var process = global.process;
|
|
@@ -39,7 +39,7 @@ if (!queueMicrotask) {
|
|
|
39
39
|
process.nextTick(flush);
|
|
40
40
|
};
|
|
41
41
|
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
|
42
|
-
} else if (MutationObserver &&
|
|
42
|
+
} else if (MutationObserver && !IS_IOS) {
|
|
43
43
|
toggle = true;
|
|
44
44
|
node = document.createTextNode('');
|
|
45
45
|
new MutationObserver(flush).observe(node, { characterData: true });
|
package/internals/shared.js
CHANGED
|
@@ -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.
|
|
7
|
+
version: '3.4.1',
|
|
8
8
|
mode: IS_PURE ? 'pure' : 'global',
|
|
9
9
|
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
|
10
10
|
});
|
package/internals/task.js
CHANGED
|
@@ -4,7 +4,7 @@ var classof = require('../internals/classof-raw');
|
|
|
4
4
|
var bind = require('../internals/bind-context');
|
|
5
5
|
var html = require('../internals/html');
|
|
6
6
|
var createElement = require('../internals/document-create-element');
|
|
7
|
-
var
|
|
7
|
+
var IS_IOS = require('../internals/is-ios');
|
|
8
8
|
|
|
9
9
|
var location = global.location;
|
|
10
10
|
var set = global.setImmediate;
|
|
@@ -69,7 +69,7 @@ if (!set || !clear) {
|
|
|
69
69
|
};
|
|
70
70
|
// Browsers with MessageChannel, includes WebWorkers
|
|
71
71
|
// except iOS - https://github.com/zloirock/core-js/issues/624
|
|
72
|
-
} else if (MessageChannel &&
|
|
72
|
+
} else if (MessageChannel && !IS_IOS) {
|
|
73
73
|
channel = new MessageChannel();
|
|
74
74
|
port = channel.port2;
|
|
75
75
|
channel.port1.onmessage = listener;
|
|
@@ -17,6 +17,6 @@ module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
|
|
|
17
17
|
new Int8Array(1.5);
|
|
18
18
|
new Int8Array(iterable);
|
|
19
19
|
}, true) || fails(function () {
|
|
20
|
-
// Safari 11 bug
|
|
20
|
+
// Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
|
|
21
21
|
return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
|
|
22
22
|
});
|
package/internals/v8-version.js
CHANGED
|
@@ -10,8 +10,11 @@ if (v8) {
|
|
|
10
10
|
match = v8.split('.');
|
|
11
11
|
version = match[0] + match[1];
|
|
12
12
|
} else if (userAgent) {
|
|
13
|
-
match = userAgent.match(/
|
|
14
|
-
if (match
|
|
13
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
|
14
|
+
if (!match || match[1] >= 74) {
|
|
15
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
|
16
|
+
if (match) version = match[1];
|
|
17
|
+
}
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
module.exports = version && +version;
|
|
@@ -9,12 +9,16 @@ var createProperty = require('../internals/create-property');
|
|
|
9
9
|
var arraySpeciesCreate = require('../internals/array-species-create');
|
|
10
10
|
var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
|
|
11
11
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
12
|
+
var V8_VERSION = require('../internals/v8-version');
|
|
12
13
|
|
|
13
14
|
var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
|
14
15
|
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
|
15
16
|
var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
// We can't use this feature detection in V8 since it causes
|
|
19
|
+
// deoptimization and serious performance degradation
|
|
20
|
+
// https://github.com/zloirock/core-js/issues/679
|
|
21
|
+
var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
|
|
18
22
|
var array = [];
|
|
19
23
|
array[IS_CONCAT_SPREADABLE] = false;
|
|
20
24
|
return array.concat()[0] !== array;
|
|
@@ -11,6 +11,7 @@ var test = [1, 2];
|
|
|
11
11
|
// https://bugs.webkit.org/show_bug.cgi?id=188794
|
|
12
12
|
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
|
13
13
|
reverse: function reverse() {
|
|
14
|
+
// eslint-disable-next-line no-self-assign
|
|
14
15
|
if (isArray(this)) this.length = this.length;
|
|
15
16
|
return nativeReverse.call(this);
|
|
16
17
|
}
|
package/modules/es.array.sort.js
CHANGED
|
@@ -5,8 +5,8 @@ var toObject = require('../internals/to-object');
|
|
|
5
5
|
var fails = require('../internals/fails');
|
|
6
6
|
var sloppyArrayMethod = require('../internals/sloppy-array-method');
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var test = [];
|
|
9
|
+
var nativeSort = test.sort;
|
|
10
10
|
|
|
11
11
|
// IE8-
|
|
12
12
|
var FAILS_ON_UNDEFINED = fails(function () {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var $ = require('../internals/export');
|
|
2
|
+
var getBuiltIn = require('../internals/get-built-in');
|
|
3
|
+
var fails = require('../internals/fails');
|
|
4
|
+
|
|
5
|
+
var $stringify = getBuiltIn('JSON', 'stringify');
|
|
6
|
+
var re = /[\uD800-\uDFFF]/g;
|
|
7
|
+
var low = /^[\uD800-\uDBFF]$/;
|
|
8
|
+
var hi = /^[\uDC00-\uDFFF]$/;
|
|
9
|
+
|
|
10
|
+
var fix = function (match, offset, string) {
|
|
11
|
+
var prev = string.charAt(offset - 1);
|
|
12
|
+
var next = string.charAt(offset + 1);
|
|
13
|
+
if ((low.test(match) && !hi.test(next)) || (hi.test(match) && !low.test(prev))) {
|
|
14
|
+
return '\\u' + match.charCodeAt(0).toString(16);
|
|
15
|
+
} return match;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var FORCED = fails(function () {
|
|
19
|
+
return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
|
20
|
+
|| $stringify('\uDEAD') !== '"\\udead"';
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
if ($stringify) {
|
|
24
|
+
// https://github.com/tc39/proposal-well-formed-stringify
|
|
25
|
+
$({ target: 'JSON', stat: true, forced: FORCED }, {
|
|
26
|
+
// eslint-disable-next-line no-unused-vars
|
|
27
|
+
stringify: function stringify(it, replacer, space) {
|
|
28
|
+
var result = $stringify.apply(null, arguments);
|
|
29
|
+
return typeof result == 'string' ? result.replace(re, fix) : result;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
package/modules/es.promise.js
CHANGED
|
@@ -6,6 +6,7 @@ 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');
|
|
9
10
|
var setToStringTag = require('../internals/set-to-string-tag');
|
|
10
11
|
var setSpecies = require('../internals/set-species');
|
|
11
12
|
var isObject = require('../internals/is-object');
|
|
@@ -35,6 +36,7 @@ var PromiseConstructor = NativePromise;
|
|
|
35
36
|
var TypeError = global.TypeError;
|
|
36
37
|
var document = global.document;
|
|
37
38
|
var process = global.process;
|
|
39
|
+
var inspectSource = shared('inspectSource');
|
|
38
40
|
var $fetch = getBuiltIn('fetch');
|
|
39
41
|
var newPromiseCapability = newPromiseCapabilityModule.f;
|
|
40
42
|
var newGenericPromiseCapability = newPromiseCapability;
|
|
@@ -50,20 +52,27 @@ var UNHANDLED = 2;
|
|
|
50
52
|
var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
|
51
53
|
|
|
52
54
|
var FORCED = isForced(PROMISE, function () {
|
|
53
|
-
|
|
55
|
+
var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
|
|
56
|
+
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
57
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
58
|
+
// We can't detect it synchronously, so just check versions
|
|
59
|
+
if (V8_VERSION === 66) return true;
|
|
60
|
+
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
|
61
|
+
if (!GLOBAL_CORE_JS_PROMISE && !IS_NODE && typeof PromiseRejectionEvent != 'function') return true;
|
|
62
|
+
// We need Promise#finally in the pure version for preventing prototype pollution
|
|
63
|
+
if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
|
|
64
|
+
// We can't use @@species feature detection in V8 since it causes
|
|
65
|
+
// deoptimization and performance degradation
|
|
66
|
+
// https://github.com/zloirock/core-js/issues/679
|
|
67
|
+
if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
|
|
68
|
+
// Detect correctness of subclassing with @@species support
|
|
54
69
|
var promise = PromiseConstructor.resolve(1);
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
exec(empty, empty);
|
|
70
|
+
var FakePromise = function (exec) {
|
|
71
|
+
exec(function () { /* empty */ }, function () { /* empty */ });
|
|
58
72
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
&& promise.then(empty) instanceof FakePromise
|
|
63
|
-
// v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
|
|
64
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
|
|
65
|
-
// we can't detect it synchronously, so just check versions
|
|
66
|
-
&& V8_VERSION !== 66);
|
|
73
|
+
var constructor = promise.constructor = {};
|
|
74
|
+
constructor[SPECIES] = FakePromise;
|
|
75
|
+
return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
|
|
67
76
|
});
|
|
68
77
|
|
|
69
78
|
var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
|
package/modules/es.symbol.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var $ = require('../internals/export');
|
|
3
3
|
var global = require('../internals/global');
|
|
4
|
+
var getBuiltIn = require('../internals/get-built-in');
|
|
4
5
|
var IS_PURE = require('../internals/is-pure');
|
|
5
6
|
var DESCRIPTORS = require('../internals/descriptors');
|
|
6
7
|
var NATIVE_SYMBOL = require('../internals/native-symbol');
|
|
@@ -42,8 +43,7 @@ var setInternalState = InternalStateModule.set;
|
|
|
42
43
|
var getInternalState = InternalStateModule.getterFor(SYMBOL);
|
|
43
44
|
var ObjectPrototype = Object[PROTOTYPE];
|
|
44
45
|
var $Symbol = global.Symbol;
|
|
45
|
-
var
|
|
46
|
-
var nativeJSONStringify = JSON && JSON.stringify;
|
|
46
|
+
var $stringify = getBuiltIn('JSON', 'stringify');
|
|
47
47
|
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
48
48
|
var nativeDefineProperty = definePropertyModule.f;
|
|
49
49
|
var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
|
@@ -264,30 +264,35 @@ $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymb
|
|
|
264
264
|
|
|
265
265
|
// `JSON.stringify` method behavior with symbols
|
|
266
266
|
// https://tc39.github.io/ecma262/#sec-json.stringify
|
|
267
|
-
|
|
268
|
-
var
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
267
|
+
if ($stringify) {
|
|
268
|
+
var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
|
|
269
|
+
var symbol = $Symbol();
|
|
270
|
+
// MS Edge converts symbol values to JSON as {}
|
|
271
|
+
return $stringify([symbol]) != '[null]'
|
|
272
|
+
// WebKit converts symbol values to JSON as null
|
|
273
|
+
|| $stringify({ a: symbol }) != '{}'
|
|
274
|
+
// V8 throws on boxed symbols
|
|
275
|
+
|| $stringify(Object(symbol)) != '{}';
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
$({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
|
|
279
|
+
// eslint-disable-next-line no-unused-vars
|
|
280
|
+
stringify: function stringify(it, replacer, space) {
|
|
281
|
+
var args = [it];
|
|
282
|
+
var index = 1;
|
|
283
|
+
var $replacer;
|
|
284
|
+
while (arguments.length > index) args.push(arguments[index++]);
|
|
285
|
+
$replacer = replacer;
|
|
286
|
+
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
|
|
287
|
+
if (!isArray(replacer)) replacer = function (key, value) {
|
|
288
|
+
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
|
289
|
+
if (!isSymbol(value)) return value;
|
|
290
|
+
};
|
|
291
|
+
args[1] = replacer;
|
|
292
|
+
return $stringify.apply(null, args);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
}
|
|
291
296
|
|
|
292
297
|
// `Symbol.prototype[@@toPrimitive]` method
|
|
293
298
|
// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
|
|
@@ -8,7 +8,6 @@ var defineProperty = require('../internals/object-define-property');
|
|
|
8
8
|
var createPropertyDescriptor = require('../internals/create-property-descriptor');
|
|
9
9
|
var iterate = require('../internals/iterate');
|
|
10
10
|
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
11
|
-
var anObject = require('../internals/an-object');
|
|
12
11
|
var InternalStateModule = require('../internals/internal-state');
|
|
13
12
|
|
|
14
13
|
var setInternalState = InternalStateModule.set;
|
|
@@ -31,14 +30,7 @@ var $AggregateError = function AggregateError(errors, message) {
|
|
|
31
30
|
$AggregateError.prototype = create(Error.prototype, {
|
|
32
31
|
constructor: createPropertyDescriptor(5, $AggregateError),
|
|
33
32
|
message: createPropertyDescriptor(5, ''),
|
|
34
|
-
name: createPropertyDescriptor(5, 'AggregateError')
|
|
35
|
-
toString: createPropertyDescriptor(5, function toString() {
|
|
36
|
-
var name = anObject(this).name;
|
|
37
|
-
name = name === undefined ? 'AggregateError' : String(name);
|
|
38
|
-
var message = this.message;
|
|
39
|
-
message = message === undefined ? '' : String(message);
|
|
40
|
-
return name + ': ' + message;
|
|
41
|
-
})
|
|
33
|
+
name: createPropertyDescriptor(5, 'AggregateError')
|
|
42
34
|
});
|
|
43
35
|
|
|
44
36
|
if (DESCRIPTORS) defineProperty.f($AggregateError.prototype, 'errors', {
|
|
@@ -20,6 +20,10 @@ if (!has(AsyncIteratorPrototype, TO_STRING_TAG)) {
|
|
|
20
20
|
createNonEnumerableProperty(AsyncIteratorPrototype, TO_STRING_TAG, 'AsyncIterator');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
if (!has(AsyncIteratorPrototype, 'constructor') || AsyncIteratorPrototype.constructor === Object) {
|
|
24
|
+
createNonEnumerableProperty(AsyncIteratorPrototype, 'constructor', AsyncIteratorConstructor);
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
$({ global: true, forced: IS_PURE }, {
|
|
24
28
|
AsyncIterator: AsyncIteratorConstructor
|
|
25
29
|
});
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var $ = require('../internals/export');
|
|
4
4
|
var aFunction = require('../internals/a-function');
|
|
5
5
|
var anObject = require('../internals/an-object');
|
|
6
|
-
var isObject = require('../internals/is-object');
|
|
7
6
|
var createAsyncIteratorProxy = require('../internals/create-async-iterator-proxy');
|
|
8
7
|
var getAsyncIteratorMethod = require('../internals/get-async-iterator-method');
|
|
9
8
|
|
|
@@ -23,11 +22,12 @@ var AsyncIteratorProxy = createAsyncIteratorProxy(function (arg, Promise) {
|
|
|
23
22
|
} else {
|
|
24
23
|
Promise.resolve(mapper(step.value)).then(function (mapped) {
|
|
25
24
|
try {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
iteratorMethod = getAsyncIteratorMethod(mapped);
|
|
26
|
+
if (iteratorMethod !== undefined) {
|
|
27
|
+
state.innerIterator = innerIterator = anObject(iteratorMethod.call(mapped));
|
|
28
28
|
state.innerNext = aFunction(innerIterator.next);
|
|
29
29
|
return innerLoop();
|
|
30
|
-
}
|
|
30
|
+
} reject(TypeError('.flatMap callback should return an iterable object'));
|
|
31
31
|
} catch (error2) { reject(error2); }
|
|
32
32
|
}, reject);
|
|
33
33
|
}
|
|
@@ -32,6 +32,10 @@ if (!has(IteratorPrototype, TO_STRING_TAG)) {
|
|
|
32
32
|
createNonEnumerableProperty(IteratorPrototype, TO_STRING_TAG, 'Iterator');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
if (!has(IteratorPrototype, 'constructor') || IteratorPrototype.constructor === Object) {
|
|
36
|
+
createNonEnumerableProperty(IteratorPrototype, 'constructor', IteratorConstructor);
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
IteratorConstructor.prototype = IteratorPrototype;
|
|
36
40
|
|
|
37
41
|
$({ global: true, forced: FORCED }, {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var $ = require('../internals/export');
|
|
4
4
|
var aFunction = require('../internals/a-function');
|
|
5
5
|
var anObject = require('../internals/an-object');
|
|
6
|
-
var isObject = require('../internals/is-object');
|
|
7
6
|
var getIteratorMethod = require('../internals/get-iterator-method');
|
|
8
7
|
var createIteratorProxy = require('../internals/create-iterator-proxy');
|
|
9
8
|
var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
|
|
@@ -24,12 +23,14 @@ var IteratorProxy = createIteratorProxy(function (arg) {
|
|
|
24
23
|
if (this.done = !!result.done) return;
|
|
25
24
|
|
|
26
25
|
mapped = callWithSafeIterationClosing(iterator, this.mapper, result.value);
|
|
26
|
+
iteratorMethod = getIteratorMethod(mapped);
|
|
27
27
|
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
if (iteratorMethod === undefined) {
|
|
29
|
+
throw TypeError('.flatMap callback should return an iterable object');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
this.innerIterator = innerIterator = anObject(iteratorMethod.call(mapped));
|
|
33
|
+
this.innerNext = aFunction(innerIterator.next);
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
|
|
@@ -4,6 +4,6 @@ var $ = require('../internals/export');
|
|
|
4
4
|
// https://github.com/tc39/proposal-Math.signbit
|
|
5
5
|
$({ target: 'Math', stat: true }, {
|
|
6
6
|
signbit: function signbit(x) {
|
|
7
|
-
return (x = +x)
|
|
7
|
+
return (x = +x) == x && x == 0 ? 1 / x == -Infinity : x < 0;
|
|
8
8
|
}
|
|
9
9
|
});
|
|
@@ -14,7 +14,7 @@ var RegExpPrototype = RegExp.prototype;
|
|
|
14
14
|
$({ target: 'String', proto: true }, {
|
|
15
15
|
replaceAll: function replaceAll(searchValue, replaceValue) {
|
|
16
16
|
var O = requireObjectCoercible(this);
|
|
17
|
-
var IS_REG_EXP, flags, replacer, string, searchString, template, result, index;
|
|
17
|
+
var IS_REG_EXP, flags, replacer, string, searchString, template, result, position, index;
|
|
18
18
|
if (searchValue != null) {
|
|
19
19
|
IS_REG_EXP = isRegExp(searchValue);
|
|
20
20
|
if (IS_REG_EXP) {
|
|
@@ -33,14 +33,16 @@ $({ target: 'String', proto: true }, {
|
|
|
33
33
|
}
|
|
34
34
|
string = String(O);
|
|
35
35
|
searchString = String(searchValue);
|
|
36
|
-
if (searchString === '') return replaceAll.call(
|
|
36
|
+
if (searchString === '') return replaceAll.call(string, /(?:)/g, replaceValue);
|
|
37
37
|
template = string.split(searchString);
|
|
38
38
|
if (typeof replaceValue !== 'function') {
|
|
39
39
|
return template.join(String(replaceValue));
|
|
40
40
|
}
|
|
41
41
|
result = template[0];
|
|
42
|
+
position = result.length;
|
|
42
43
|
for (index = 1; index < template.length; index++) {
|
|
43
|
-
result += String(replaceValue(searchString,
|
|
44
|
+
result += String(replaceValue(searchString, position, string));
|
|
45
|
+
position += searchString.length + template[index].length;
|
|
44
46
|
result += template[index];
|
|
45
47
|
}
|
|
46
48
|
return result;
|
|
@@ -325,7 +325,7 @@ if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'functio
|
|
|
325
325
|
if (isObject(init)) {
|
|
326
326
|
body = init.body;
|
|
327
327
|
if (classof(body) === URL_SEARCH_PARAMS) {
|
|
328
|
-
headers = new Headers(init.headers);
|
|
328
|
+
headers = init.headers ? new Headers(init.headers) : new Headers();
|
|
329
329
|
if (!headers.has('content-type')) {
|
|
330
330
|
headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
|
331
331
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core-js-pure",
|
|
3
3
|
"description": "Standard library",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/zloirock/core-js.git"
|
|
8
8
|
},
|
|
9
9
|
"main": "index.js",
|
|
10
|
+
"funding": {
|
|
11
|
+
"type": "opencollective",
|
|
12
|
+
"url": "https://opencollective.com/core-js"
|
|
13
|
+
},
|
|
10
14
|
"license": "MIT",
|
|
11
15
|
"keywords": [
|
|
12
16
|
"ES3",
|
|
@@ -18,6 +22,7 @@
|
|
|
18
22
|
"ES2017",
|
|
19
23
|
"ES2018",
|
|
20
24
|
"ES2019",
|
|
25
|
+
"ES2020",
|
|
21
26
|
"ECMAScript 3",
|
|
22
27
|
"ECMAScript 5",
|
|
23
28
|
"ECMAScript 6",
|
|
@@ -27,6 +32,7 @@
|
|
|
27
32
|
"ECMAScript 2017",
|
|
28
33
|
"ECMAScript 2018",
|
|
29
34
|
"ECMAScript 2019",
|
|
35
|
+
"ECMAScript 2020",
|
|
30
36
|
"Harmony",
|
|
31
37
|
"Strawman",
|
|
32
38
|
"Map",
|