core-js 3.1.3 → 3.3.0
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/README.md +1 -1
- package/configurator.js +7 -0
- package/es/global-this.js +3 -0
- package/es/index.js +2 -0
- package/es/promise/all-settled.js +11 -0
- package/es/promise/index.js +1 -0
- package/features/array/index.js +1 -0
- package/features/array/is-template-object.js +4 -0
- package/features/async-iterator/as-indexed-pairs.js +10 -0
- package/features/async-iterator/drop.js +10 -0
- package/features/async-iterator/every.js +10 -0
- package/features/async-iterator/filter.js +10 -0
- package/features/async-iterator/find.js +10 -0
- package/features/async-iterator/flat-map.js +10 -0
- package/features/async-iterator/for-each.js +10 -0
- package/features/async-iterator/from.js +10 -0
- package/features/async-iterator/index.js +22 -0
- package/features/async-iterator/map.js +10 -0
- package/features/async-iterator/reduce.js +10 -0
- package/features/async-iterator/some.js +10 -0
- package/features/async-iterator/take.js +10 -0
- package/features/async-iterator/to-array.js +10 -0
- package/features/global-this.js +1 -3
- package/features/iterator/as-indexed-pairs.js +10 -0
- package/features/iterator/drop.js +9 -0
- package/features/iterator/every.js +9 -0
- package/features/iterator/filter.js +9 -0
- package/features/iterator/find.js +9 -0
- package/features/iterator/flat-map.js +9 -0
- package/features/iterator/for-each.js +9 -0
- package/features/iterator/from.js +9 -0
- package/features/iterator/index.js +21 -0
- package/features/iterator/map.js +9 -0
- package/features/iterator/reduce.js +9 -0
- package/features/iterator/some.js +9 -0
- package/features/iterator/take.js +9 -0
- package/features/iterator/to-array.js +9 -0
- package/features/map/from.js +2 -0
- package/features/map/index.js +3 -0
- package/features/map/of.js +2 -0
- package/features/map/update-or-insert.js +6 -0
- package/features/map/upsert.js +5 -0
- package/features/promise/all-settled.js +2 -9
- package/features/promise/index.js +1 -0
- package/features/set/difference.js +2 -0
- package/features/set/from.js +2 -0
- package/features/set/is-subset-of.js +2 -0
- package/features/set/of.js +2 -0
- package/features/set/symmetric-difference.js +2 -0
- package/features/set/union.js +2 -0
- package/features/symbol/async-dispose.js +4 -0
- package/features/symbol/index.js +1 -0
- package/features/weak-map/from.js +2 -0
- package/features/weak-map/index.js +1 -0
- package/features/weak-map/of.js +2 -0
- package/features/weak-map/upsert.js +5 -0
- package/features/weak-set/from.js +2 -0
- package/features/weak-set/of.js +2 -0
- package/internals/a-possible-prototype.js +7 -0
- package/internals/add-to-unscopables.js +2 -2
- package/internals/advance-string-index.js +2 -2
- package/internals/array-buffer-view-core.js +5 -4
- package/internals/array-buffer.js +21 -16
- package/internals/array-copy-within.js +3 -1
- package/internals/array-for-each.js +3 -6
- package/internals/array-from.js +4 -3
- package/internals/array-includes.js +12 -7
- package/internals/{array-methods.js → array-iteration.js} +30 -18
- package/internals/array-last-index-of.js +3 -2
- package/internals/array-reduce.js +30 -21
- package/internals/async-iterator-iteration.js +61 -0
- package/internals/async-iterator-prototype.js +37 -0
- package/internals/collection-delete-all.js +3 -1
- package/internals/collection-from.js +3 -2
- package/internals/collection-weak.js +5 -5
- package/internals/collection.js +14 -14
- package/internals/composite-key.js +1 -0
- package/internals/create-async-iterator-proxy.js +61 -0
- package/internals/create-iterator-proxy.js +51 -0
- package/internals/{hide.js → create-non-enumerable-property.js} +0 -0
- package/internals/date-to-iso-string.js +12 -14
- package/internals/define-iterator.js +3 -3
- package/internals/document-create-element.js +2 -2
- package/internals/export.js +2 -2
- package/internals/fix-regexp-well-known-symbol-logic.js +2 -2
- package/internals/function-bind.js +3 -3
- package/internals/get-async-iterator-method.js +9 -0
- package/internals/global.js +4 -5
- package/internals/html.js +2 -4
- package/internals/indexed-object.js +1 -1
- package/internals/inherit-if-required.js +13 -6
- package/internals/internal-state.js +2 -2
- package/internals/iterate.js +21 -12
- package/internals/iterators-core.js +4 -2
- package/internals/map-upsert.js +23 -0
- package/internals/math-expm1.js +2 -1
- package/internals/math-fround.js +2 -1
- package/internals/math-log1p.js +3 -1
- package/internals/microtask.js +4 -3
- package/internals/native-promise-constructor.js +3 -0
- package/internals/native-url.js +13 -4
- package/internals/not-a-regexp.js +7 -0
- package/internals/object-assign.js +2 -1
- package/internals/object-create.js +2 -1
- package/internals/object-define-properties.js +4 -2
- package/internals/object-define-property.js +2 -0
- package/internals/object-get-own-property-descriptor.js +2 -0
- package/internals/object-get-own-property-names.js +2 -1
- package/internals/object-get-prototype-of.js +2 -1
- package/internals/object-keys-internal.js +2 -4
- package/internals/object-keys.js +2 -1
- package/internals/object-property-is-enumerable.js +2 -0
- package/internals/object-set-prototype-of.js +9 -5
- package/internals/object-to-array.js +25 -15
- package/internals/own-keys.js +2 -4
- package/internals/parse-float.js +7 -5
- package/internals/parse-int.js +6 -4
- package/internals/punycode-to-ascii.js +2 -4
- package/internals/redefine.js +3 -3
- package/internals/reflect-metadata.js +1 -0
- package/internals/regexp-flags.js +1 -0
- package/internals/set-global.js +2 -2
- package/internals/set-species.js +8 -5
- package/internals/shared-store.js +7 -0
- package/internals/shared.js +2 -6
- package/internals/string-multibyte.js +27 -0
- package/internals/string-pad.js +25 -11
- package/internals/string-trim.js +20 -8
- package/internals/task.js +3 -1
- package/internals/to-offset.js +3 -3
- package/internals/to-positive-integer.js +7 -0
- package/internals/to-primitive.js +7 -6
- package/internals/typed-array-constructor.js +15 -12
- package/internals/typed-array-from.js +3 -2
- package/internals/uid.js +1 -1
- package/internals/user-agent.js +2 -4
- package/modules/es.array.every.js +3 -6
- package/modules/es.array.fill.js +3 -1
- package/modules/es.array.filter.js +3 -6
- package/modules/es.array.find-index.js +2 -3
- package/modules/es.array.find.js +2 -3
- package/modules/es.array.flat-map.js +1 -1
- package/modules/es.array.flat.js +1 -1
- package/modules/es.array.includes.js +2 -4
- package/modules/es.array.index-of.js +2 -3
- package/modules/es.array.is-array.js +3 -1
- package/modules/es.array.map.js +3 -6
- package/modules/es.array.reduce-right.js +3 -4
- package/modules/es.array.reduce.js +3 -5
- package/modules/es.array.slice.js +1 -3
- package/modules/es.array.some.js +3 -6
- package/modules/es.array.splice.js +1 -3
- package/modules/es.date.to-primitive.js +4 -2
- package/modules/es.global-this.js +8 -0
- package/modules/es.map.js +1 -1
- package/modules/es.math.hypot.js +6 -1
- package/modules/es.number.constructor.js +9 -10
- package/modules/es.number.to-fixed.js +57 -53
- package/modules/es.object.entries.js +2 -2
- package/modules/es.object.get-own-property-descriptors.js +3 -3
- package/modules/es.object.get-prototype-of.js +1 -0
- package/modules/es.object.values.js +2 -2
- package/modules/es.promise.all-settled.js +43 -0
- package/modules/es.promise.finally.js +8 -0
- package/modules/es.promise.js +30 -14
- package/modules/es.reflect.apply.js +2 -2
- package/modules/es.reflect.construct.js +4 -4
- package/modules/es.reflect.define-property.js +5 -5
- package/modules/es.reflect.delete-property.js +1 -1
- package/modules/es.reflect.get-own-property-descriptor.js +2 -2
- package/modules/es.reflect.get-prototype-of.js +1 -1
- package/modules/es.reflect.get.js +3 -3
- package/modules/es.reflect.set-prototype-of.js +4 -2
- package/modules/es.reflect.set.js +3 -3
- package/modules/es.regexp.constructor.js +3 -3
- package/modules/es.regexp.to-string.js +1 -1
- package/modules/es.set.js +1 -1
- package/modules/es.string.code-point-at.js +2 -2
- package/modules/es.string.ends-with.js +6 -5
- package/modules/es.string.includes.js +4 -3
- package/modules/es.string.iterator.js +2 -2
- package/modules/es.string.match-all.js +22 -7
- package/modules/es.string.pad-end.js +2 -2
- package/modules/es.string.pad-start.js +2 -2
- package/modules/es.string.starts-with.js +8 -6
- package/modules/es.string.trim-end.js +2 -2
- package/modules/es.string.trim-start.js +2 -2
- package/modules/es.string.trim.js +3 -5
- package/modules/es.symbol.js +97 -87
- package/modules/es.typed-array.copy-within.js +2 -2
- package/modules/es.typed-array.every.js +2 -3
- package/modules/es.typed-array.fill.js +2 -2
- package/modules/es.typed-array.filter.js +3 -4
- package/modules/es.typed-array.find-index.js +2 -3
- package/modules/es.typed-array.find.js +2 -3
- package/modules/es.typed-array.for-each.js +2 -3
- package/modules/es.typed-array.includes.js +2 -3
- package/modules/es.typed-array.index-of.js +2 -3
- package/modules/es.typed-array.iterator.js +1 -1
- package/modules/es.typed-array.join.js +2 -2
- package/modules/es.typed-array.last-index-of.js +2 -2
- package/modules/es.typed-array.map.js +5 -7
- package/modules/es.typed-array.of.js +1 -1
- package/modules/es.typed-array.reduce-right.js +2 -2
- package/modules/es.typed-array.reduce.js +2 -2
- package/modules/es.typed-array.reverse.js +2 -1
- package/modules/es.typed-array.set.js +2 -2
- package/modules/es.typed-array.slice.js +3 -3
- package/modules/es.typed-array.some.js +2 -3
- package/modules/es.typed-array.sort.js +2 -2
- package/modules/es.typed-array.subarray.js +1 -1
- package/modules/es.typed-array.to-locale-string.js +7 -6
- package/modules/es.weak-map.js +1 -1
- package/modules/es.weak-set.js +1 -1
- package/modules/esnext.aggregate-error.js +28 -4
- package/modules/esnext.array.is-template-object.js +28 -0
- package/modules/esnext.async-iterator.as-indexed-pairs.js +27 -0
- package/modules/esnext.async-iterator.constructor.js +25 -0
- package/modules/esnext.async-iterator.drop.js +41 -0
- package/modules/esnext.async-iterator.every.js +10 -0
- package/modules/esnext.async-iterator.filter.js +42 -0
- package/modules/esnext.async-iterator.find.js +10 -0
- package/modules/esnext.async-iterator.flat-map.js +67 -0
- package/modules/esnext.async-iterator.for-each.js +10 -0
- package/modules/esnext.async-iterator.from.js +30 -0
- package/modules/esnext.async-iterator.map.js +30 -0
- package/modules/esnext.async-iterator.reduce.js +46 -0
- package/modules/esnext.async-iterator.some.js +10 -0
- package/modules/esnext.async-iterator.take.js +22 -0
- package/modules/esnext.async-iterator.to-array.js +10 -0
- package/modules/esnext.global-this.js +2 -6
- package/modules/esnext.iterator.as-indexed-pairs.js +20 -0
- package/modules/esnext.iterator.constructor.js +39 -0
- package/modules/esnext.iterator.drop.js +30 -0
- package/modules/esnext.iterator.every.js +16 -0
- package/modules/esnext.iterator.filter.js +30 -0
- package/modules/esnext.iterator.find.js +16 -0
- package/modules/esnext.iterator.flat-map.js +45 -0
- package/modules/esnext.iterator.for-each.js +11 -0
- package/modules/esnext.iterator.from.js +32 -0
- package/modules/esnext.iterator.map.js +23 -0
- package/modules/esnext.iterator.reduce.js +25 -0
- package/modules/esnext.iterator.some.js +16 -0
- package/modules/esnext.iterator.take.js +25 -0
- package/modules/esnext.iterator.to-array.js +15 -0
- package/modules/esnext.map.every.js +4 -5
- package/modules/esnext.map.filter.js +4 -5
- package/modules/esnext.map.find-key.js +4 -5
- package/modules/esnext.map.find.js +4 -5
- package/modules/esnext.map.includes.js +4 -7
- package/modules/esnext.map.key-of.js +4 -7
- package/modules/esnext.map.map-keys.js +4 -5
- package/modules/esnext.map.map-values.js +4 -5
- package/modules/esnext.map.reduce.js +12 -11
- package/modules/esnext.map.some.js +4 -5
- package/modules/esnext.map.update-or-insert.js +11 -0
- package/modules/esnext.map.update.js +3 -2
- package/modules/esnext.map.upsert.js +10 -0
- package/modules/esnext.math.signbit.js +0 -1
- package/modules/esnext.observable.js +26 -25
- package/modules/esnext.promise.all-settled.js +2 -43
- package/modules/esnext.reflect.get-metadata-keys.js +1 -0
- package/modules/esnext.set.every.js +4 -4
- package/modules/esnext.set.filter.js +4 -4
- package/modules/esnext.set.find.js +4 -4
- package/modules/esnext.set.is-disjoint-from.js +3 -5
- package/modules/esnext.set.is-subset-of.js +3 -5
- package/modules/esnext.set.is-superset-of.js +3 -5
- package/modules/esnext.set.join.js +2 -2
- package/modules/esnext.set.map.js +4 -4
- package/modules/esnext.set.reduce.js +12 -10
- package/modules/esnext.set.some.js +4 -4
- package/modules/esnext.string.at.js +2 -2
- package/modules/esnext.string.code-points.js +5 -3
- package/modules/esnext.string.match-all.js +0 -1
- package/modules/esnext.string.replace-all.js +16 -22
- package/modules/esnext.symbol.async-dispose.js +5 -0
- package/modules/esnext.symbol.dispose.js +1 -1
- package/modules/esnext.symbol.replace-all.js +1 -2
- package/modules/esnext.weak-map.upsert.js +10 -0
- package/modules/web.dom-collections.for-each.js +2 -2
- package/modules/web.dom-collections.iterator.js +6 -4
- package/modules/web.immediate.js +5 -0
- package/modules/web.timers.js +12 -7
- package/modules/web.url-search-params.js +52 -41
- package/modules/web.url.js +45 -43
- package/package.json +2 -2
- package/postinstall.js +49 -0
- package/proposals/array-is-template-object.js +1 -0
- package/proposals/iterator-helpers.js +20 -0
- package/proposals/map-update-or-insert.js +2 -0
- package/proposals/map-upsert.js +5 -0
- package/proposals/promise-all-settled.js +1 -0
- package/proposals/string-match-all.js +0 -2
- package/proposals/using-statement.js +1 -0
- package/stable/global-this.js +1 -3
- package/stable/promise/all-settled.js +1 -0
- package/stage/1.js +1 -3
- package/stage/2.js +4 -1
- package/stage/3.js +2 -2
- package/stage/4.js +2 -0
- package/LICENSE +0 -19
- package/internals/enum-keys.js +0 -16
- package/internals/string-at.js +0 -17
- package/internals/validate-set-prototype-of-arguments.js +0 -9
- package/internals/validate-string-method-arguments.js +0 -9
- package/scripts/postinstall.js +0 -23
package/internals/collection.js
CHANGED
|
@@ -22,17 +22,17 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
|
|
|
22
22
|
var fixMethod = function (KEY) {
|
|
23
23
|
var nativeMethod = NativePrototype[KEY];
|
|
24
24
|
redefine(NativePrototype, KEY,
|
|
25
|
-
KEY == 'add' ? function add(
|
|
26
|
-
nativeMethod.call(this,
|
|
25
|
+
KEY == 'add' ? function add(value) {
|
|
26
|
+
nativeMethod.call(this, value === 0 ? 0 : value);
|
|
27
27
|
return this;
|
|
28
|
-
} : KEY == 'delete' ? function (
|
|
29
|
-
return IS_WEAK && !isObject(
|
|
30
|
-
} : KEY == 'get' ? function get(
|
|
31
|
-
return IS_WEAK && !isObject(
|
|
32
|
-
} : KEY == 'has' ? function has(
|
|
33
|
-
return IS_WEAK && !isObject(
|
|
34
|
-
} : function set(
|
|
35
|
-
nativeMethod.call(this,
|
|
28
|
+
} : KEY == 'delete' ? function (key) {
|
|
29
|
+
return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
|
|
30
|
+
} : KEY == 'get' ? function get(key) {
|
|
31
|
+
return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
|
|
32
|
+
} : KEY == 'has' ? function has(key) {
|
|
33
|
+
return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
|
|
34
|
+
} : function set(key, value) {
|
|
35
|
+
nativeMethod.call(this, key === 0 ? 0 : key, value);
|
|
36
36
|
return this;
|
|
37
37
|
}
|
|
38
38
|
);
|
|
@@ -49,7 +49,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
|
|
|
49
49
|
var instance = new Constructor();
|
|
50
50
|
// early implementations not supports chaining
|
|
51
51
|
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
|
|
52
|
-
// V8 ~
|
|
52
|
+
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
|
|
53
53
|
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
|
|
54
54
|
// most early implementations doesn't supports iterables, most modern - not close it correctly
|
|
55
55
|
// eslint-disable-next-line no-new
|
|
@@ -64,9 +64,9 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
|
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
if (!ACCEPT_ITERABLES) {
|
|
67
|
-
Constructor = wrapper(function (
|
|
68
|
-
anInstance(
|
|
69
|
-
var that = inheritIfRequired(new NativeConstructor(),
|
|
67
|
+
Constructor = wrapper(function (dummy, iterable) {
|
|
68
|
+
anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
|
|
69
|
+
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
|
70
70
|
if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP);
|
|
71
71
|
return that;
|
|
72
72
|
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var path = require('../internals/path');
|
|
3
|
+
var aFunction = require('../internals/a-function');
|
|
4
|
+
var anObject = require('../internals/an-object');
|
|
5
|
+
var create = require('../internals/object-create');
|
|
6
|
+
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
7
|
+
var redefineAll = require('../internals/redefine-all');
|
|
8
|
+
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
9
|
+
var InternalStateModule = require('../internals/internal-state');
|
|
10
|
+
var getBuiltIn = require('../internals/get-built-in');
|
|
11
|
+
|
|
12
|
+
var Promise = getBuiltIn('Promise');
|
|
13
|
+
|
|
14
|
+
var setInternalState = InternalStateModule.set;
|
|
15
|
+
var getInternalState = InternalStateModule.get;
|
|
16
|
+
|
|
17
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
18
|
+
|
|
19
|
+
var $return = function (value) {
|
|
20
|
+
var iterator = getInternalState(this).iterator;
|
|
21
|
+
var $$return = iterator['return'];
|
|
22
|
+
return $$return === undefined
|
|
23
|
+
? Promise.resolve({ done: true, value: value })
|
|
24
|
+
: anObject($$return.call(iterator, value));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var $throw = function (value) {
|
|
28
|
+
var iterator = getInternalState(this).iterator;
|
|
29
|
+
var $$throw = iterator['throw'];
|
|
30
|
+
return $$throw === undefined
|
|
31
|
+
? Promise.reject(value)
|
|
32
|
+
: $$throw.call(iterator, value);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
module.exports = function (nextHandler, IS_ITERATOR) {
|
|
36
|
+
var AsyncIteratorProxy = function AsyncIterator(state) {
|
|
37
|
+
state.next = aFunction(state.iterator.next);
|
|
38
|
+
state.done = false;
|
|
39
|
+
setInternalState(this, state);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
AsyncIteratorProxy.prototype = redefineAll(create(path.AsyncIterator.prototype), {
|
|
43
|
+
next: function next(arg) {
|
|
44
|
+
var state = getInternalState(this);
|
|
45
|
+
if (state.done) return Promise.resolve({ done: true, value: undefined });
|
|
46
|
+
try {
|
|
47
|
+
return Promise.resolve(anObject(nextHandler.call(state, arg, Promise)));
|
|
48
|
+
} catch (error) {
|
|
49
|
+
return Promise.reject(error);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
'return': $return,
|
|
53
|
+
'throw': $throw
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
if (!IS_ITERATOR) {
|
|
57
|
+
createNonEnumerableProperty(AsyncIteratorProxy.prototype, TO_STRING_TAG, 'Generator');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return AsyncIteratorProxy;
|
|
61
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var path = require('../internals/path');
|
|
3
|
+
var aFunction = require('../internals/a-function');
|
|
4
|
+
var anObject = require('../internals/an-object');
|
|
5
|
+
var create = require('../internals/object-create');
|
|
6
|
+
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
7
|
+
var redefineAll = require('../internals/redefine-all');
|
|
8
|
+
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
9
|
+
var InternalStateModule = require('../internals/internal-state');
|
|
10
|
+
|
|
11
|
+
var setInternalState = InternalStateModule.set;
|
|
12
|
+
var getInternalState = InternalStateModule.get;
|
|
13
|
+
|
|
14
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
15
|
+
|
|
16
|
+
var $return = function (value) {
|
|
17
|
+
var iterator = getInternalState(this).iterator;
|
|
18
|
+
var $$return = iterator['return'];
|
|
19
|
+
return $$return === undefined ? { done: true, value: value } : anObject($$return.call(iterator, value));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var $throw = function (value) {
|
|
23
|
+
var iterator = getInternalState(this).iterator;
|
|
24
|
+
var $$throw = iterator['throw'];
|
|
25
|
+
if ($$throw === undefined) throw value;
|
|
26
|
+
return $$throw.call(iterator, value);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports = function (nextHandler, IS_ITERATOR) {
|
|
30
|
+
var IteratorProxy = function Iterator(state) {
|
|
31
|
+
state.next = aFunction(state.iterator.next);
|
|
32
|
+
state.done = false;
|
|
33
|
+
setInternalState(this, state);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
IteratorProxy.prototype = redefineAll(create(path.Iterator.prototype), {
|
|
37
|
+
next: function next() {
|
|
38
|
+
var state = getInternalState(this);
|
|
39
|
+
var result = state.done ? undefined : nextHandler.apply(state, arguments);
|
|
40
|
+
return { done: state.done, value: result };
|
|
41
|
+
},
|
|
42
|
+
'return': $return,
|
|
43
|
+
'throw': $throw
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (!IS_ITERATOR) {
|
|
47
|
+
createNonEnumerableProperty(IteratorProxy.prototype, TO_STRING_TAG, 'Generator');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return IteratorProxy;
|
|
51
|
+
};
|
|
File without changes
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var fails = require('../internals/fails');
|
|
3
|
+
var padStart = require('../internals/string-pad').start;
|
|
3
4
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
var leadingZero = function (number) {
|
|
9
|
-
return number > 9 ? number : '0' + number;
|
|
10
|
-
};
|
|
5
|
+
var abs = Math.abs;
|
|
6
|
+
var DatePrototype = Date.prototype;
|
|
7
|
+
var getTime = DatePrototype.getTime;
|
|
8
|
+
var nativeDateToISOString = DatePrototype.toISOString;
|
|
11
9
|
|
|
12
10
|
// `Date.prototype.toISOString` method implementation
|
|
13
11
|
// https://tc39.github.io/ecma262/#sec-date.prototype.toisostring
|
|
@@ -22,12 +20,12 @@ module.exports = (fails(function () {
|
|
|
22
20
|
var year = date.getUTCFullYear();
|
|
23
21
|
var milliseconds = date.getUTCMilliseconds();
|
|
24
22
|
var sign = year < 0 ? '-' : year > 9999 ? '+' : '';
|
|
25
|
-
return sign + (
|
|
26
|
-
'-' +
|
|
27
|
-
'-' +
|
|
28
|
-
'T' +
|
|
29
|
-
':' +
|
|
30
|
-
':' +
|
|
31
|
-
'.' + (milliseconds
|
|
23
|
+
return sign + padStart(abs(year), sign ? 6 : 4, 0) +
|
|
24
|
+
'-' + padStart(date.getUTCMonth() + 1, 2, 0) +
|
|
25
|
+
'-' + padStart(date.getUTCDate(), 2, 0) +
|
|
26
|
+
'T' + padStart(date.getUTCHours(), 2, 0) +
|
|
27
|
+
':' + padStart(date.getUTCMinutes(), 2, 0) +
|
|
28
|
+
':' + padStart(date.getUTCSeconds(), 2, 0) +
|
|
29
|
+
'.' + padStart(milliseconds, 3, 0) +
|
|
32
30
|
'Z';
|
|
33
31
|
} : nativeDateToISOString;
|
|
@@ -4,7 +4,7 @@ var createIteratorConstructor = require('../internals/create-iterator-constructo
|
|
|
4
4
|
var getPrototypeOf = require('../internals/object-get-prototype-of');
|
|
5
5
|
var setPrototypeOf = require('../internals/object-set-prototype-of');
|
|
6
6
|
var setToStringTag = require('../internals/set-to-string-tag');
|
|
7
|
-
var
|
|
7
|
+
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
8
8
|
var redefine = require('../internals/redefine');
|
|
9
9
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
10
10
|
var IS_PURE = require('../internals/is-pure');
|
|
@@ -51,7 +51,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|
|
|
51
51
|
if (setPrototypeOf) {
|
|
52
52
|
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
|
53
53
|
} else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
|
|
54
|
-
|
|
54
|
+
createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
// Set @@toStringTag to native iterators
|
|
@@ -68,7 +68,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|
|
|
68
68
|
|
|
69
69
|
// define iterator
|
|
70
70
|
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
|
|
71
|
-
|
|
71
|
+
createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
|
|
72
72
|
}
|
|
73
73
|
Iterators[NAME] = defaultIterator;
|
|
74
74
|
|
|
@@ -3,8 +3,8 @@ var isObject = require('../internals/is-object');
|
|
|
3
3
|
|
|
4
4
|
var document = global.document;
|
|
5
5
|
// typeof document.createElement is 'object' in old IE
|
|
6
|
-
var
|
|
6
|
+
var EXISTS = isObject(document) && isObject(document.createElement);
|
|
7
7
|
|
|
8
8
|
module.exports = function (it) {
|
|
9
|
-
return
|
|
9
|
+
return EXISTS ? document.createElement(it) : {};
|
|
10
10
|
};
|
package/internals/export.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var global = require('../internals/global');
|
|
2
2
|
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
|
|
3
|
-
var
|
|
3
|
+
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
4
4
|
var redefine = require('../internals/redefine');
|
|
5
5
|
var setGlobal = require('../internals/set-global');
|
|
6
6
|
var copyConstructorProperties = require('../internals/copy-constructor-properties');
|
|
@@ -46,7 +46,7 @@ module.exports = function (options, source) {
|
|
|
46
46
|
}
|
|
47
47
|
// add a flag to not completely full polyfills
|
|
48
48
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
49
|
-
|
|
49
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
50
50
|
}
|
|
51
51
|
// extend global
|
|
52
52
|
redefine(target, key, sourceProperty, options);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var
|
|
2
|
+
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
3
3
|
var redefine = require('../internals/redefine');
|
|
4
4
|
var fails = require('../internals/fails');
|
|
5
5
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
@@ -88,6 +88,6 @@ module.exports = function (KEY, length, exec, sham) {
|
|
|
88
88
|
// 21.2.5.9 RegExp.prototype[@@search](string)
|
|
89
89
|
: function (string) { return regexMethod.call(string, this); }
|
|
90
90
|
);
|
|
91
|
-
if (sham)
|
|
91
|
+
if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
|
|
92
92
|
}
|
|
93
93
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var aFunction = require('../internals/a-function');
|
|
3
3
|
var isObject = require('../internals/is-object');
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var slice = [].slice;
|
|
6
6
|
var factories = {};
|
|
7
7
|
|
|
8
8
|
var construct = function (C, argsLength, args) {
|
|
@@ -17,9 +17,9 @@ var construct = function (C, argsLength, args) {
|
|
|
17
17
|
// https://tc39.github.io/ecma262/#sec-function.prototype.bind
|
|
18
18
|
module.exports = Function.bind || function bind(that /* , ...args */) {
|
|
19
19
|
var fn = aFunction(this);
|
|
20
|
-
var partArgs =
|
|
20
|
+
var partArgs = slice.call(arguments, 1);
|
|
21
21
|
var boundFunction = function bound(/* args... */) {
|
|
22
|
-
var args = partArgs.concat(
|
|
22
|
+
var args = partArgs.concat(slice.call(arguments));
|
|
23
23
|
return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);
|
|
24
24
|
};
|
|
25
25
|
if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var getIteratorMethod = require('../internals/get-iterator-method');
|
|
2
|
+
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
3
|
+
|
|
4
|
+
var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator');
|
|
5
|
+
|
|
6
|
+
module.exports = function (it) {
|
|
7
|
+
var method = it[ASYNC_ITERATOR];
|
|
8
|
+
return method === undefined ? getIteratorMethod(it) : method;
|
|
9
|
+
};
|
package/internals/global.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var O = 'object';
|
|
2
1
|
var check = function (it) {
|
|
3
2
|
return it && it.Math == Math && it;
|
|
4
3
|
};
|
|
@@ -6,9 +5,9 @@ var check = function (it) {
|
|
|
6
5
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
7
6
|
module.exports =
|
|
8
7
|
// eslint-disable-next-line no-undef
|
|
9
|
-
check(typeof globalThis ==
|
|
10
|
-
check(typeof window ==
|
|
11
|
-
check(typeof self ==
|
|
12
|
-
check(typeof global ==
|
|
8
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
9
|
+
check(typeof window == 'object' && window) ||
|
|
10
|
+
check(typeof self == 'object' && self) ||
|
|
11
|
+
check(typeof global == 'object' && global) ||
|
|
13
12
|
// eslint-disable-next-line no-new-func
|
|
14
13
|
Function('return this')();
|
package/internals/html.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
2
1
|
var fails = require('../internals/fails');
|
|
3
2
|
var classof = require('../internals/classof-raw');
|
|
4
3
|
|
|
5
4
|
var split = ''.split;
|
|
6
5
|
|
|
6
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
7
7
|
module.exports = fails(function () {
|
|
8
8
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
9
9
|
// eslint-disable-next-line no-prototype-builtins
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
var isObject = require('../internals/is-object');
|
|
2
2
|
var setPrototypeOf = require('../internals/object-set-prototype-of');
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
if (
|
|
8
|
-
setPrototypeOf
|
|
9
|
-
|
|
4
|
+
// makes subclassing work correct for wrapped built-ins
|
|
5
|
+
module.exports = function ($this, dummy, Wrapper) {
|
|
6
|
+
var NewTarget, NewTargetPrototype;
|
|
7
|
+
if (
|
|
8
|
+
// it can work only with native `setPrototypeOf`
|
|
9
|
+
setPrototypeOf &&
|
|
10
|
+
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
|
|
11
|
+
typeof (NewTarget = dummy.constructor) == 'function' &&
|
|
12
|
+
NewTarget !== Wrapper &&
|
|
13
|
+
isObject(NewTargetPrototype = NewTarget.prototype) &&
|
|
14
|
+
NewTargetPrototype !== Wrapper.prototype
|
|
15
|
+
) setPrototypeOf($this, NewTargetPrototype);
|
|
16
|
+
return $this;
|
|
10
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var NATIVE_WEAK_MAP = require('../internals/native-weak-map');
|
|
2
2
|
var global = require('../internals/global');
|
|
3
3
|
var isObject = require('../internals/is-object');
|
|
4
|
-
var
|
|
4
|
+
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
5
5
|
var objectHas = require('../internals/has');
|
|
6
6
|
var sharedKey = require('../internals/shared-key');
|
|
7
7
|
var hiddenKeys = require('../internals/hidden-keys');
|
|
@@ -41,7 +41,7 @@ if (NATIVE_WEAK_MAP) {
|
|
|
41
41
|
var STATE = sharedKey('state');
|
|
42
42
|
hiddenKeys[STATE] = true;
|
|
43
43
|
set = function (it, metadata) {
|
|
44
|
-
|
|
44
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
|
45
45
|
return metadata;
|
|
46
46
|
};
|
|
47
47
|
get = function (it) {
|
package/internals/iterate.js
CHANGED
|
@@ -5,13 +5,16 @@ var bind = require('../internals/bind-context');
|
|
|
5
5
|
var getIteratorMethod = require('../internals/get-iterator-method');
|
|
6
6
|
var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var Result = function (stopped, result) {
|
|
9
|
+
this.stopped = stopped;
|
|
10
|
+
this.result = result;
|
|
11
|
+
};
|
|
9
12
|
|
|
10
|
-
var
|
|
11
|
-
var boundFunction = bind(fn, that,
|
|
12
|
-
var iterator, iterFn, index, length, result, step;
|
|
13
|
+
var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
|
|
14
|
+
var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1);
|
|
15
|
+
var iterator, iterFn, index, length, result, next, step;
|
|
13
16
|
|
|
14
|
-
if (
|
|
17
|
+
if (IS_ITERATOR) {
|
|
15
18
|
iterator = iterable;
|
|
16
19
|
} else {
|
|
17
20
|
iterFn = getIteratorMethod(iterable);
|
|
@@ -19,16 +22,22 @@ var exports = module.exports = function (iterable, fn, that, ENTRIES, ITERATOR)
|
|
|
19
22
|
// optimisation for array iterators
|
|
20
23
|
if (isArrayIteratorMethod(iterFn)) {
|
|
21
24
|
for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
|
22
|
-
result =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
result = AS_ENTRIES
|
|
26
|
+
? boundFunction(anObject(step = iterable[index])[0], step[1])
|
|
27
|
+
: boundFunction(iterable[index]);
|
|
28
|
+
if (result && result instanceof Result) return result;
|
|
29
|
+
} return new Result(false);
|
|
25
30
|
}
|
|
26
31
|
iterator = iterFn.call(iterable);
|
|
27
32
|
}
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
next = iterator.next;
|
|
35
|
+
while (!(step = next.call(iterator)).done) {
|
|
36
|
+
result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
|
|
37
|
+
if (typeof result == 'object' && result && result instanceof Result) return result;
|
|
38
|
+
} return new Result(false);
|
|
32
39
|
};
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
iterate.stop = function (result) {
|
|
42
|
+
return new Result(true, result);
|
|
43
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var getPrototypeOf = require('../internals/object-get-prototype-of');
|
|
3
|
-
var
|
|
3
|
+
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
|
|
4
4
|
var has = require('../internals/has');
|
|
5
5
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
6
6
|
var IS_PURE = require('../internals/is-pure');
|
|
@@ -27,7 +27,9 @@ if ([].keys) {
|
|
|
27
27
|
if (IteratorPrototype == undefined) IteratorPrototype = {};
|
|
28
28
|
|
|
29
29
|
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
|
30
|
-
if (!IS_PURE && !has(IteratorPrototype, ITERATOR))
|
|
30
|
+
if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
|
|
31
|
+
createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
|
|
32
|
+
}
|
|
31
33
|
|
|
32
34
|
module.exports = {
|
|
33
35
|
IteratorPrototype: IteratorPrototype,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var anObject = require('../internals/an-object');
|
|
3
|
+
|
|
4
|
+
// `Map.prototype.upsert` method
|
|
5
|
+
// https://github.com/thumbsupep/proposal-upsert
|
|
6
|
+
module.exports = function upsert(key, updateFn /* , insertFn */) {
|
|
7
|
+
var map = anObject(this);
|
|
8
|
+
var insertFn = arguments.length > 2 ? arguments[2] : undefined;
|
|
9
|
+
var value;
|
|
10
|
+
if (typeof updateFn != 'function' && typeof insertFn != 'function') {
|
|
11
|
+
throw TypeError('At least one callback required');
|
|
12
|
+
}
|
|
13
|
+
if (map.has(key)) {
|
|
14
|
+
value = map.get(key);
|
|
15
|
+
if (typeof updateFn == 'function') {
|
|
16
|
+
value = updateFn(value);
|
|
17
|
+
map.set(key, value);
|
|
18
|
+
}
|
|
19
|
+
} else if (typeof insertFn == 'function') {
|
|
20
|
+
value = insertFn();
|
|
21
|
+
map.set(key, value);
|
|
22
|
+
} return value;
|
|
23
|
+
};
|
package/internals/math-expm1.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var nativeExpm1 = Math.expm1;
|
|
2
|
+
var exp = Math.exp;
|
|
2
3
|
|
|
3
4
|
// `Math.expm1` method implementation
|
|
4
5
|
// https://tc39.github.io/ecma262/#sec-math.expm1
|
|
@@ -8,5 +9,5 @@ module.exports = (!nativeExpm1
|
|
|
8
9
|
// Tor Browser bug
|
|
9
10
|
|| nativeExpm1(-2e-17) != -2e-17
|
|
10
11
|
) ? function expm1(x) {
|
|
11
|
-
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 :
|
|
12
|
+
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
|
|
12
13
|
} : nativeExpm1;
|
package/internals/math-fround.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var sign = require('../internals/math-sign');
|
|
2
2
|
|
|
3
|
+
var abs = Math.abs;
|
|
3
4
|
var pow = Math.pow;
|
|
4
5
|
var EPSILON = pow(2, -52);
|
|
5
6
|
var EPSILON32 = pow(2, -23);
|
|
@@ -13,7 +14,7 @@ var roundTiesToEven = function (n) {
|
|
|
13
14
|
// `Math.fround` method implementation
|
|
14
15
|
// https://tc39.github.io/ecma262/#sec-math.fround
|
|
15
16
|
module.exports = Math.fround || function fround(x) {
|
|
16
|
-
var $abs =
|
|
17
|
+
var $abs = abs(x);
|
|
17
18
|
var $sign = sign(x);
|
|
18
19
|
var a, result;
|
|
19
20
|
if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
|
package/internals/math-log1p.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
var log = Math.log;
|
|
2
|
+
|
|
1
3
|
// `Math.log1p` method implementation
|
|
2
4
|
// https://tc39.github.io/ecma262/#sec-math.log1p
|
|
3
5
|
module.exports = Math.log1p || function log1p(x) {
|
|
4
|
-
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 :
|
|
6
|
+
return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
|
|
5
7
|
};
|
package/internals/microtask.js
CHANGED
|
@@ -12,7 +12,7 @@ var IS_NODE = classof(process) == 'process';
|
|
|
12
12
|
var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
|
|
13
13
|
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
|
14
14
|
|
|
15
|
-
var flush, head, last, notify, toggle, node, promise;
|
|
15
|
+
var flush, head, last, notify, toggle, node, promise, then;
|
|
16
16
|
|
|
17
17
|
// modern engines have queueMicrotask method
|
|
18
18
|
if (!queueMicrotask) {
|
|
@@ -42,7 +42,7 @@ if (!queueMicrotask) {
|
|
|
42
42
|
} else if (MutationObserver && !/(iphone|ipod|ipad).*applewebkit/i.test(userAgent)) {
|
|
43
43
|
toggle = true;
|
|
44
44
|
node = document.createTextNode('');
|
|
45
|
-
new MutationObserver(flush).observe(node, { characterData: true });
|
|
45
|
+
new MutationObserver(flush).observe(node, { characterData: true });
|
|
46
46
|
notify = function () {
|
|
47
47
|
node.data = toggle = !toggle;
|
|
48
48
|
};
|
|
@@ -50,8 +50,9 @@ if (!queueMicrotask) {
|
|
|
50
50
|
} else if (Promise && Promise.resolve) {
|
|
51
51
|
// Promise.resolve without an argument throws an error in LG WebOS 2
|
|
52
52
|
promise = Promise.resolve(undefined);
|
|
53
|
+
then = promise.then;
|
|
53
54
|
notify = function () {
|
|
54
|
-
|
|
55
|
+
then.call(promise, flush);
|
|
55
56
|
};
|
|
56
57
|
// for other environments - macrotask based on:
|
|
57
58
|
// - setImmediate
|
package/internals/native-url.js
CHANGED
|
@@ -5,13 +5,18 @@ var IS_PURE = require('../internals/is-pure');
|
|
|
5
5
|
var ITERATOR = wellKnownSymbol('iterator');
|
|
6
6
|
|
|
7
7
|
module.exports = !fails(function () {
|
|
8
|
-
var url = new URL('b?
|
|
8
|
+
var url = new URL('b?a=1&b=2&c=3', 'http://a');
|
|
9
9
|
var searchParams = url.searchParams;
|
|
10
|
+
var result = '';
|
|
10
11
|
url.pathname = 'c%20d';
|
|
12
|
+
searchParams.forEach(function (value, key) {
|
|
13
|
+
searchParams['delete']('b');
|
|
14
|
+
result += key + value;
|
|
15
|
+
});
|
|
11
16
|
return (IS_PURE && !url.toJSON)
|
|
12
17
|
|| !searchParams.sort
|
|
13
|
-
|| url.href !== 'http://a/c%20d?
|
|
14
|
-
|| searchParams.get('
|
|
18
|
+
|| url.href !== 'http://a/c%20d?a=1&c=3'
|
|
19
|
+
|| searchParams.get('c') !== '3'
|
|
15
20
|
|| String(new URLSearchParams('?a=1')) !== 'a=1'
|
|
16
21
|
|| !searchParams[ITERATOR]
|
|
17
22
|
// throws in Edge
|
|
@@ -20,5 +25,9 @@ module.exports = !fails(function () {
|
|
|
20
25
|
// not punycoded in Edge
|
|
21
26
|
|| new URL('http://тест').host !== 'xn--e1aybc'
|
|
22
27
|
// not escaped in Chrome 62-
|
|
23
|
-
|| new URL('http://a#б').hash !== '#%D0%B1'
|
|
28
|
+
|| new URL('http://a#б').hash !== '#%D0%B1'
|
|
29
|
+
// fails in Chrome 66-
|
|
30
|
+
|| result !== 'a1c3'
|
|
31
|
+
// throws in Safari
|
|
32
|
+
|| new URL('http://x', undefined).host !== 'x';
|
|
24
33
|
});
|
|
@@ -9,7 +9,8 @@ var IndexedObject = require('../internals/indexed-object');
|
|
|
9
9
|
|
|
10
10
|
var nativeAssign = Object.assign;
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// `Object.assign` method
|
|
13
|
+
// https://tc39.github.io/ecma262/#sec-object.assign
|
|
13
14
|
// should work with symbols and should have deterministic property order (V8 bug)
|
|
14
15
|
module.exports = !nativeAssign || fails(function () {
|
|
15
16
|
var A = {};
|
|
@@ -32,7 +32,8 @@ var createDict = function () {
|
|
|
32
32
|
return createDict();
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
//
|
|
35
|
+
// `Object.create` method
|
|
36
|
+
// https://tc39.github.io/ecma262/#sec-object.create
|
|
36
37
|
module.exports = Object.create || function create(O, Properties) {
|
|
37
38
|
var result;
|
|
38
39
|
if (O !== null) {
|