core-js-pure 3.32.0 → 3.32.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.
- package/internals/array-includes.js +2 -2
- package/internals/array-iteration-from-last.js +1 -1
- package/internals/array-iteration.js +7 -7
- package/internals/array-slice-simple.js +2 -1
- package/internals/async-iterator-iteration.js +4 -4
- package/internals/caller.js +1 -1
- package/internals/check-correctness-of-iteration.js +3 -1
- package/internals/classof.js +2 -2
- package/internals/collection-strong.js +5 -5
- package/internals/collection.js +5 -4
- package/internals/date-to-iso-string.js +1 -1
- package/internals/descriptors.js +1 -1
- package/internals/engine-is-node.js +2 -1
- package/internals/function-bind.js +3 -1
- package/internals/get-json-replacer-function.js +1 -1
- package/internals/get-set-record.js +1 -1
- package/internals/global.js +1 -1
- package/internals/host-report-errors.js +1 -1
- package/internals/ie8-dom-define.js +1 -1
- package/internals/ieee754.js +25 -14
- package/internals/indexed-object.js +1 -1
- package/internals/is-array.js +1 -1
- package/internals/is-big-int-array.js +1 -1
- package/internals/is-forced.js +2 -2
- package/internals/is-regexp.js +1 -1
- package/internals/iterator-define.js +7 -4
- package/internals/math-expm1.js +3 -2
- package/internals/math-fround.js +1 -1
- package/internals/math-scale.js +1 -1
- package/internals/math-sign.js +1 -1
- package/internals/number-parse-float.js +1 -1
- package/internals/numeric-range-iterator.js +1 -1
- package/internals/object-assign.js +2 -2
- package/internals/object-get-own-property-names-external.js +1 -1
- package/internals/object-is-extensible.js +1 -1
- package/internals/parse-json-string.js +3 -3
- package/internals/same-value-zero.js +1 -1
- package/internals/same-value.js +1 -1
- package/internals/schedulers-fix.js +1 -1
- package/internals/shared.js +2 -2
- package/internals/string-pad.js +1 -1
- package/internals/string-punycode-to-ascii.js +4 -4
- package/internals/string-repeat.js +1 -1
- package/internals/structured-clone-proper-transfer.js +1 -1
- package/internals/symbol-constructor-detection.js +1 -1
- package/internals/symbol-is-well-known.js +1 -0
- package/internals/v8-prototype-define-bug.js +1 -1
- package/modules/es.array.for-each.js +1 -1
- package/modules/es.array.iterator.js +4 -3
- package/modules/es.array.join.js +1 -1
- package/modules/es.date.set-year.js +1 -1
- package/modules/es.date.to-json.js +1 -1
- package/modules/es.json.stringify.js +4 -4
- package/modules/es.math.acosh.js +2 -2
- package/modules/es.math.asinh.js +1 -1
- package/modules/es.math.atanh.js +1 -1
- package/modules/es.math.expm1.js +1 -1
- package/modules/es.math.imul.js +1 -1
- package/modules/es.math.sinh.js +1 -1
- package/modules/es.math.tanh.js +1 -1
- package/modules/es.number.constructor.js +14 -3
- package/modules/es.number.is-nan.js +1 -1
- package/modules/es.number.parse-float.js +1 -1
- package/modules/es.number.parse-int.js +1 -1
- package/modules/es.number.to-fixed.js +1 -1
- package/modules/es.object.is-frozen.js +1 -1
- package/modules/es.object.is-sealed.js +1 -1
- package/modules/es.parse-float.js +1 -1
- package/modules/es.parse-int.js +1 -1
- package/modules/es.promise.constructor.js +2 -2
- package/modules/es.reflect.construct.js +1 -1
- package/modules/es.string.from-code-point.js +1 -1
- package/modules/es.string.is-well-formed.js +2 -2
- package/modules/es.string.match-all.js +1 -1
- package/modules/es.string.to-well-formed.js +2 -2
- package/modules/es.symbol.constructor.js +1 -1
- package/modules/es.weak-map.constructor.js +2 -2
- package/modules/esnext.async-disposable-stack.constructor.js +3 -3
- package/modules/esnext.composite-symbol.js +1 -1
- package/modules/esnext.disposable-stack.constructor.js +3 -3
- package/modules/esnext.json.parse.js +15 -15
- package/modules/esnext.json.raw-json.js +3 -3
- package/modules/esnext.math.signbit.js +1 -1
- package/modules/esnext.number.from-string.js +1 -1
- package/modules/esnext.set.intersection.v2.js +1 -1
- package/modules/esnext.string.dedent.js +8 -3
- package/modules/web.atob.js +2 -2
- package/modules/web.dom-exception.constructor.js +1 -1
- package/modules/web.structured-clone.js +4 -4
- package/modules/web.url.constructor.js +129 -125
- package/package.json +1 -1
- package/postinstall.js +1 -0
|
@@ -43,7 +43,7 @@ var ucs2decode = function (string) {
|
|
|
43
43
|
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
|
44
44
|
// It's a high surrogate, and there is a next character.
|
|
45
45
|
var extra = charCodeAt(string, counter++);
|
|
46
|
-
if ((extra & 0xFC00)
|
|
46
|
+
if ((extra & 0xFC00) === 0xDC00) { // Low surrogate.
|
|
47
47
|
push(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
|
48
48
|
} else {
|
|
49
49
|
// It's an unmatched surrogate; only append this code unit, in case the
|
|
@@ -142,12 +142,12 @@ var encode = function (input) {
|
|
|
142
142
|
if (currentValue < n && ++delta > maxInt) {
|
|
143
143
|
throw $RangeError(OVERFLOW_ERROR);
|
|
144
144
|
}
|
|
145
|
-
if (currentValue
|
|
145
|
+
if (currentValue === n) {
|
|
146
146
|
// Represent delta as a generalized variable-length integer.
|
|
147
147
|
var q = delta;
|
|
148
148
|
var k = base;
|
|
149
149
|
while (true) {
|
|
150
|
-
var t = k <= bias ? tMin :
|
|
150
|
+
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
|
|
151
151
|
if (q < t) break;
|
|
152
152
|
var qMinusT = q - t;
|
|
153
153
|
var baseMinusT = base - t;
|
|
@@ -157,7 +157,7 @@ var encode = function (input) {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
push(output, fromCharCode(digitToBasic(q)));
|
|
160
|
-
bias = adapt(delta, handledCPCountPlusOne, handledCPCount
|
|
160
|
+
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
|
|
161
161
|
delta = 0;
|
|
162
162
|
handledCPCount++;
|
|
163
163
|
}
|
|
@@ -11,7 +11,7 @@ module.exports = function repeat(count) {
|
|
|
11
11
|
var str = toString(requireObjectCoercible(this));
|
|
12
12
|
var result = '';
|
|
13
13
|
var n = toIntegerOrInfinity(count);
|
|
14
|
-
if (n < 0 || n
|
|
14
|
+
if (n < 0 || n === Infinity) throw $RangeError('Wrong number of repetitions');
|
|
15
15
|
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
|
|
16
16
|
return result;
|
|
17
17
|
};
|
|
@@ -14,5 +14,5 @@ module.exports = !!structuredClone && !fails(function () {
|
|
|
14
14
|
if ((IS_DENO && V8 > 92) || (IS_NODE && V8 > 94) || (IS_BROWSER && V8 > 97)) return false;
|
|
15
15
|
var buffer = new ArrayBuffer(8);
|
|
16
16
|
var clone = structuredClone(buffer, { transfer: [buffer] });
|
|
17
|
-
return buffer.byteLength
|
|
17
|
+
return buffer.byteLength !== 0 || clone.byteLength !== 8;
|
|
18
18
|
});
|
|
@@ -8,7 +8,7 @@ var $String = global.String;
|
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
10
10
|
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
11
|
-
var symbol = Symbol();
|
|
11
|
+
var symbol = Symbol('symbol detection');
|
|
12
12
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
13
13
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
14
14
|
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
@@ -27,6 +27,7 @@ module.exports = function isWellKnownSymbol(value) {
|
|
|
27
27
|
try {
|
|
28
28
|
var symbol = thisSymbolValue(value);
|
|
29
29
|
for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) {
|
|
30
|
+
// eslint-disable-next-line eqeqeq -- polyfilled symbols case
|
|
30
31
|
if (WellKnownSymbolsStore[keys[j]] == symbol) return true;
|
|
31
32
|
}
|
|
32
33
|
} catch (error) { /* empty */ }
|
|
@@ -5,6 +5,6 @@ var forEach = require('../internals/array-for-each');
|
|
|
5
5
|
// `Array.prototype.forEach` method
|
|
6
6
|
// https://tc39.es/ecma262/#sec-array.prototype.foreach
|
|
7
7
|
// eslint-disable-next-line es/no-array-prototype-foreach -- safe
|
|
8
|
-
$({ target: 'Array', proto: true, forced: [].forEach
|
|
8
|
+
$({ target: 'Array', proto: true, forced: [].forEach !== forEach }, {
|
|
9
9
|
forEach: forEach
|
|
10
10
|
});
|
|
@@ -41,9 +41,10 @@ module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
|
|
|
41
41
|
state.target = undefined;
|
|
42
42
|
return createIterResultObject(undefined, true);
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
switch (kind) {
|
|
45
|
+
case 'keys': return createIterResultObject(index, false);
|
|
46
|
+
case 'values': return createIterResultObject(target[index], false);
|
|
47
|
+
} return createIterResultObject([index, target[index]], false);
|
|
47
48
|
}, 'values');
|
|
48
49
|
|
|
49
50
|
// argumentsList[@@iterator] is %ArrayProto_values%
|
package/modules/es.array.join.js
CHANGED
|
@@ -7,7 +7,7 @@ var arrayMethodIsStrict = require('../internals/array-method-is-strict');
|
|
|
7
7
|
|
|
8
8
|
var nativeJoin = uncurryThis([].join);
|
|
9
9
|
|
|
10
|
-
var ES3_STRINGS = IndexedObject
|
|
10
|
+
var ES3_STRINGS = IndexedObject !== Object;
|
|
11
11
|
var FORCED = ES3_STRINGS || !arrayMethodIsStrict('join', ',');
|
|
12
12
|
|
|
13
13
|
// `Array.prototype.join` method
|
|
@@ -14,7 +14,7 @@ $({ target: 'Date', proto: true }, {
|
|
|
14
14
|
// validate
|
|
15
15
|
thisTimeValue(this);
|
|
16
16
|
var yi = toIntegerOrInfinity(year);
|
|
17
|
-
var yyyy =
|
|
17
|
+
var yyyy = yi >= 0 && yi <= 99 ? yi + 1900 : yi;
|
|
18
18
|
return setFullYear(this, yyyy);
|
|
19
19
|
}
|
|
20
20
|
});
|
|
@@ -20,6 +20,6 @@ $({ target: 'Date', proto: true, forced: FORCED }, {
|
|
|
20
20
|
var O = toObject(this);
|
|
21
21
|
var pv = toPrimitive(O, 'number');
|
|
22
22
|
return typeof pv == 'number' && !isFinite(pv) ? null :
|
|
23
|
-
(!('toISOString' in O) && classof(O)
|
|
23
|
+
(!('toISOString' in O) && classof(O) === 'Date') ? call(toISOString, O) : O.toISOString();
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -24,13 +24,13 @@ var low = /^[\uD800-\uDBFF]$/;
|
|
|
24
24
|
var hi = /^[\uDC00-\uDFFF]$/;
|
|
25
25
|
|
|
26
26
|
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
|
|
27
|
-
var symbol = getBuiltIn('Symbol')();
|
|
27
|
+
var symbol = getBuiltIn('Symbol')('stringify detection');
|
|
28
28
|
// MS Edge converts symbol values to JSON as {}
|
|
29
|
-
return $stringify([symbol])
|
|
29
|
+
return $stringify([symbol]) !== '[null]'
|
|
30
30
|
// WebKit converts symbol values to JSON as null
|
|
31
|
-
|| $stringify({ a: symbol })
|
|
31
|
+
|| $stringify({ a: symbol }) !== '{}'
|
|
32
32
|
// V8 throws on boxed symbols
|
|
33
|
-
|| $stringify(Object(symbol))
|
|
33
|
+
|| $stringify(Object(symbol)) !== '{}';
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
// https://github.com/tc39/proposal-well-formed-stringify
|
package/modules/es.math.acosh.js
CHANGED
|
@@ -10,9 +10,9 @@ var LN2 = Math.LN2;
|
|
|
10
10
|
|
|
11
11
|
var FORCED = !$acosh
|
|
12
12
|
// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
|
|
13
|
-
|| Math.floor($acosh(Number.MAX_VALUE))
|
|
13
|
+
|| Math.floor($acosh(Number.MAX_VALUE)) !== 710
|
|
14
14
|
// Tor Browser bug: Math.acosh(Infinity) -> NaN
|
|
15
|
-
|| $acosh(Infinity)
|
|
15
|
+
|| $acosh(Infinity) !== Infinity;
|
|
16
16
|
|
|
17
17
|
// `Math.acosh` method
|
|
18
18
|
// https://tc39.es/ecma262/#sec-math.acosh
|
package/modules/es.math.asinh.js
CHANGED
|
@@ -8,7 +8,7 @@ var sqrt = Math.sqrt;
|
|
|
8
8
|
|
|
9
9
|
function asinh(x) {
|
|
10
10
|
var n = +x;
|
|
11
|
-
return !isFinite(n) || n
|
|
11
|
+
return !isFinite(n) || n === 0 ? n : n < 0 ? -asinh(-n) : log(n + sqrt(n * n + 1));
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
var FORCED = !($asinh && 1 / $asinh(0) > 0);
|
package/modules/es.math.atanh.js
CHANGED
package/modules/es.math.expm1.js
CHANGED
|
@@ -5,4 +5,4 @@ var expm1 = require('../internals/math-expm1');
|
|
|
5
5
|
// `Math.expm1` method
|
|
6
6
|
// https://tc39.es/ecma262/#sec-math.expm1
|
|
7
7
|
// eslint-disable-next-line es/no-math-expm1 -- required for testing
|
|
8
|
-
$({ target: 'Math', stat: true, forced: expm1
|
|
8
|
+
$({ target: 'Math', stat: true, forced: expm1 !== Math.expm1 }, { expm1: expm1 });
|
package/modules/es.math.imul.js
CHANGED
package/modules/es.math.sinh.js
CHANGED
package/modules/es.math.tanh.js
CHANGED
|
@@ -11,6 +11,6 @@ $({ target: 'Math', stat: true }, {
|
|
|
11
11
|
var n = +x;
|
|
12
12
|
var a = expm1(n);
|
|
13
13
|
var b = expm1(-n);
|
|
14
|
-
return a
|
|
14
|
+
return a === Infinity ? 1 : b === Infinity ? -1 : (a - b) / (exp(n) + exp(-n));
|
|
15
15
|
}
|
|
16
16
|
});
|
|
@@ -47,9 +47,20 @@ var toNumber = function (argument) {
|
|
|
47
47
|
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
|
|
48
48
|
} else if (first === 48) {
|
|
49
49
|
switch (charCodeAt(it, 1)) {
|
|
50
|
-
|
|
51
|
-
case
|
|
52
|
-
|
|
50
|
+
// fast equal of /^0b[01]+$/i
|
|
51
|
+
case 66:
|
|
52
|
+
case 98:
|
|
53
|
+
radix = 2;
|
|
54
|
+
maxCode = 49;
|
|
55
|
+
break;
|
|
56
|
+
// fast equal of /^0o[0-7]+$/i
|
|
57
|
+
case 79:
|
|
58
|
+
case 111:
|
|
59
|
+
radix = 8;
|
|
60
|
+
maxCode = 55;
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
return +it;
|
|
53
64
|
}
|
|
54
65
|
digits = stringSlice(it, 2);
|
|
55
66
|
length = digits.length;
|
|
@@ -5,6 +5,6 @@ var parseFloat = require('../internals/number-parse-float');
|
|
|
5
5
|
// `Number.parseFloat` method
|
|
6
6
|
// https://tc39.es/ecma262/#sec-number.parseFloat
|
|
7
7
|
// eslint-disable-next-line es/no-number-parsefloat -- required for testing
|
|
8
|
-
$({ target: 'Number', stat: true, forced: Number.parseFloat
|
|
8
|
+
$({ target: 'Number', stat: true, forced: Number.parseFloat !== parseFloat }, {
|
|
9
9
|
parseFloat: parseFloat
|
|
10
10
|
});
|
|
@@ -5,6 +5,6 @@ var parseInt = require('../internals/number-parse-int');
|
|
|
5
5
|
// `Number.parseInt` method
|
|
6
6
|
// https://tc39.es/ecma262/#sec-number.parseint
|
|
7
7
|
// eslint-disable-next-line es/no-number-parseint -- required for testing
|
|
8
|
-
$({ target: 'Number', stat: true, forced: Number.parseInt
|
|
8
|
+
$({ target: 'Number', stat: true, forced: Number.parseInt !== parseInt }, {
|
|
9
9
|
parseInt: parseInt
|
|
10
10
|
});
|
|
@@ -85,7 +85,7 @@ $({ target: 'Number', proto: true, forced: FORCED }, {
|
|
|
85
85
|
// TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation
|
|
86
86
|
if (fractDigits < 0 || fractDigits > 20) throw $RangeError('Incorrect fraction digits');
|
|
87
87
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
88
|
-
if (number
|
|
88
|
+
if (number !== number) return 'NaN';
|
|
89
89
|
if (number <= -1e21 || number >= 1e21) return $String(number);
|
|
90
90
|
if (number < 0) {
|
|
91
91
|
sign = '-';
|
|
@@ -15,7 +15,7 @@ var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () { $isFrozen(1); })
|
|
|
15
15
|
$({ target: 'Object', stat: true, forced: FORCED }, {
|
|
16
16
|
isFrozen: function isFrozen(it) {
|
|
17
17
|
if (!isObject(it)) return true;
|
|
18
|
-
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it)
|
|
18
|
+
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return true;
|
|
19
19
|
return $isFrozen ? $isFrozen(it) : false;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -15,7 +15,7 @@ var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () { $isSealed(1); })
|
|
|
15
15
|
$({ target: 'Object', stat: true, forced: FORCED }, {
|
|
16
16
|
isSealed: function isSealed(it) {
|
|
17
17
|
if (!isObject(it)) return true;
|
|
18
|
-
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it)
|
|
18
|
+
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return true;
|
|
19
19
|
return $isSealed ? $isSealed(it) : false;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -4,6 +4,6 @@ var $parseFloat = require('../internals/number-parse-float');
|
|
|
4
4
|
|
|
5
5
|
// `parseFloat` method
|
|
6
6
|
// https://tc39.es/ecma262/#sec-parsefloat-string
|
|
7
|
-
$({ global: true, forced: parseFloat
|
|
7
|
+
$({ global: true, forced: parseFloat !== $parseFloat }, {
|
|
8
8
|
parseFloat: $parseFloat
|
|
9
9
|
});
|
package/modules/es.parse-int.js
CHANGED
|
@@ -4,6 +4,6 @@ var $parseInt = require('../internals/number-parse-int');
|
|
|
4
4
|
|
|
5
5
|
// `parseInt` method
|
|
6
6
|
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
7
|
-
$({ global: true, forced: parseInt
|
|
7
|
+
$({ global: true, forced: parseInt !== $parseInt }, {
|
|
8
8
|
parseInt: $parseInt
|
|
9
9
|
});
|
|
@@ -57,7 +57,7 @@ var isThenable = function (it) {
|
|
|
57
57
|
|
|
58
58
|
var callReaction = function (reaction, state) {
|
|
59
59
|
var value = state.value;
|
|
60
|
-
var ok = state.state
|
|
60
|
+
var ok = state.state === FULFILLED;
|
|
61
61
|
var handler = ok ? reaction.ok : reaction.fail;
|
|
62
62
|
var resolve = reaction.resolve;
|
|
63
63
|
var reject = reaction.reject;
|
|
@@ -233,7 +233,7 @@ if (FORCED_PROMISE_CONSTRUCTOR) {
|
|
|
233
233
|
reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
|
234
234
|
reaction.fail = isCallable(onRejected) && onRejected;
|
|
235
235
|
reaction.domain = IS_NODE ? process.domain : undefined;
|
|
236
|
-
if (state.state
|
|
236
|
+
if (state.state === PENDING) state.reactions.add(reaction);
|
|
237
237
|
else microtask(function () {
|
|
238
238
|
callReaction(reaction, state);
|
|
239
239
|
});
|
|
@@ -34,7 +34,7 @@ $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
|
|
|
34
34
|
anObject(args);
|
|
35
35
|
var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
|
|
36
36
|
if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
|
37
|
-
if (Target
|
|
37
|
+
if (Target === newTarget) {
|
|
38
38
|
// w/o altered newTarget, optimization for 0-4 arguments
|
|
39
39
|
switch (args.length) {
|
|
40
40
|
case 0: return new Target();
|
|
@@ -10,7 +10,7 @@ var $fromCodePoint = String.fromCodePoint;
|
|
|
10
10
|
var join = uncurryThis([].join);
|
|
11
11
|
|
|
12
12
|
// length should be 1, old FF problem
|
|
13
|
-
var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length
|
|
13
|
+
var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1;
|
|
14
14
|
|
|
15
15
|
// `String.fromCodePoint` method
|
|
16
16
|
// https://tc39.es/ecma262/#sec-string.fromcodepoint
|
|
@@ -15,9 +15,9 @@ $({ target: 'String', proto: true }, {
|
|
|
15
15
|
for (var i = 0; i < length; i++) {
|
|
16
16
|
var charCode = charCodeAt(S, i);
|
|
17
17
|
// single UTF-16 code unit
|
|
18
|
-
if ((charCode & 0xF800)
|
|
18
|
+
if ((charCode & 0xF800) !== 0xD800) continue;
|
|
19
19
|
// unpaired surrogate
|
|
20
|
-
if (charCode >= 0xDC00 || ++i >= length || (charCodeAt(S, i) & 0xFC00)
|
|
20
|
+
if (charCode >= 0xDC00 || ++i >= length || (charCodeAt(S, i) & 0xFC00) !== 0xDC00) return false;
|
|
21
21
|
} return true;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
@@ -90,7 +90,7 @@ $({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {
|
|
|
90
90
|
}
|
|
91
91
|
if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp);
|
|
92
92
|
matcher = getMethod(regexp, MATCH_ALL);
|
|
93
|
-
if (matcher === undefined && IS_PURE && classof(regexp)
|
|
93
|
+
if (matcher === undefined && IS_PURE && classof(regexp) === 'RegExp') matcher = $matchAll;
|
|
94
94
|
if (matcher) return call(matcher, regexp, O);
|
|
95
95
|
} else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp);
|
|
96
96
|
S = toString(O);
|
|
@@ -30,9 +30,9 @@ $({ target: 'String', proto: true, forced: TO_STRING_CONVERSION_BUG }, {
|
|
|
30
30
|
for (var i = 0; i < length; i++) {
|
|
31
31
|
var charCode = charCodeAt(S, i);
|
|
32
32
|
// single UTF-16 code unit
|
|
33
|
-
if ((charCode & 0xF800)
|
|
33
|
+
if ((charCode & 0xF800) !== 0xD800) result[i] = charAt(S, i);
|
|
34
34
|
// unpaired surrogate
|
|
35
|
-
else if (charCode >= 0xDC00 || i + 1 >= length || (charCodeAt(S, i + 1) & 0xFC00)
|
|
35
|
+
else if (charCode >= 0xDC00 || i + 1 >= length || (charCodeAt(S, i + 1) & 0xFC00) !== 0xDC00) result[i] = REPLACEMENT_CHARACTER;
|
|
36
36
|
// surrogate pair
|
|
37
37
|
else {
|
|
38
38
|
result[i] = charAt(S, i);
|
|
@@ -66,7 +66,7 @@ var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChil
|
|
|
66
66
|
var setSymbolDescriptor = DESCRIPTORS && fails(function () {
|
|
67
67
|
return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
|
68
68
|
get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
|
69
|
-
})).a
|
|
69
|
+
})).a !== 7;
|
|
70
70
|
}) ? function (O, P, Attributes) {
|
|
71
71
|
var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
|
|
72
72
|
if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
|
@@ -101,8 +101,8 @@ if (NATIVE_WEAK_MAP) if (IS_IE11) {
|
|
|
101
101
|
else if (isSealed(key)) arrayIntegrityLevel = SEALED;
|
|
102
102
|
}
|
|
103
103
|
nativeSet(this, key, value);
|
|
104
|
-
if (arrayIntegrityLevel
|
|
105
|
-
if (arrayIntegrityLevel
|
|
104
|
+
if (arrayIntegrityLevel === FROZEN) freeze(key);
|
|
105
|
+
if (arrayIntegrityLevel === SEALED) seal(key);
|
|
106
106
|
return this;
|
|
107
107
|
}
|
|
108
108
|
});
|
|
@@ -29,7 +29,7 @@ var PENDING = 'pending';
|
|
|
29
29
|
|
|
30
30
|
var getPendingAsyncDisposableStackInternalState = function (stack) {
|
|
31
31
|
var internalState = getAsyncDisposableStackInternalState(stack);
|
|
32
|
-
if (internalState.state
|
|
32
|
+
if (internalState.state === DISPOSED) throw $ReferenceError(ASYNC_DISPOSABLE_STACK + ' already disposed');
|
|
33
33
|
return internalState;
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -50,7 +50,7 @@ defineBuiltIns(AsyncDisposableStackPrototype, {
|
|
|
50
50
|
var asyncDisposableStack = this;
|
|
51
51
|
return new Promise(function (resolve, reject) {
|
|
52
52
|
var internalState = getAsyncDisposableStackInternalState(asyncDisposableStack);
|
|
53
|
-
if (internalState.state
|
|
53
|
+
if (internalState.state === DISPOSED) return resolve(undefined);
|
|
54
54
|
internalState.state = DISPOSED;
|
|
55
55
|
if (!DESCRIPTORS) asyncDisposableStack.disposed = true;
|
|
56
56
|
var stack = internalState.stack;
|
|
@@ -118,7 +118,7 @@ defineBuiltIns(AsyncDisposableStackPrototype, {
|
|
|
118
118
|
if (DESCRIPTORS) defineBuiltInAccessor(AsyncDisposableStackPrototype, 'disposed', {
|
|
119
119
|
configurable: true,
|
|
120
120
|
get: function disposed() {
|
|
121
|
-
return getAsyncDisposableStackInternalState(this).state
|
|
121
|
+
return getAsyncDisposableStackInternalState(this).state === DISPOSED;
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
|
|
@@ -7,7 +7,7 @@ var apply = require('../internals/function-apply');
|
|
|
7
7
|
// https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey
|
|
8
8
|
$({ global: true, forced: true }, {
|
|
9
9
|
compositeSymbol: function compositeSymbol() {
|
|
10
|
-
if (arguments.length
|
|
10
|
+
if (arguments.length === 1 && typeof arguments[0] == 'string') return getBuiltIn('Symbol')['for'](arguments[0]);
|
|
11
11
|
return apply(getCompositeKeyNode, null, arguments).get('symbol', getBuiltIn('Symbol'));
|
|
12
12
|
}
|
|
13
13
|
});
|
|
@@ -28,7 +28,7 @@ var PENDING = 'pending';
|
|
|
28
28
|
|
|
29
29
|
var getPendingDisposableStackInternalState = function (stack) {
|
|
30
30
|
var internalState = getDisposableStackInternalState(stack);
|
|
31
|
-
if (internalState.state
|
|
31
|
+
if (internalState.state === DISPOSED) throw $ReferenceError(DISPOSABLE_STACK + ' already disposed');
|
|
32
32
|
return internalState;
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -47,7 +47,7 @@ var DisposableStackPrototype = $DisposableStack.prototype;
|
|
|
47
47
|
defineBuiltIns(DisposableStackPrototype, {
|
|
48
48
|
dispose: function dispose() {
|
|
49
49
|
var internalState = getDisposableStackInternalState(this);
|
|
50
|
-
if (internalState.state
|
|
50
|
+
if (internalState.state === DISPOSED) return;
|
|
51
51
|
internalState.state = DISPOSED;
|
|
52
52
|
if (!DESCRIPTORS) this.disposed = true;
|
|
53
53
|
var stack = internalState.stack;
|
|
@@ -102,7 +102,7 @@ defineBuiltIns(DisposableStackPrototype, {
|
|
|
102
102
|
if (DESCRIPTORS) defineBuiltInAccessor(DisposableStackPrototype, 'disposed', {
|
|
103
103
|
configurable: true,
|
|
104
104
|
get: function disposed() {
|
|
105
|
-
return getDisposableStackInternalState(this).state
|
|
105
|
+
return getDisposableStackInternalState(this).state === DISPOSED;
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
|
|
@@ -30,7 +30,7 @@ var push = uncurryThis([].push);
|
|
|
30
30
|
|
|
31
31
|
var IS_DIGIT = /^\d$/;
|
|
32
32
|
var IS_NON_ZERO_DIGIT = /^[1-9]$/;
|
|
33
|
-
var IS_NUMBER_START = /^(
|
|
33
|
+
var IS_NUMBER_START = /^(?:-|\d)$/;
|
|
34
34
|
var IS_WHITESPACE = /^[\t\n\r ]$/;
|
|
35
35
|
|
|
36
36
|
var PRIMITIVE = 0;
|
|
@@ -132,7 +132,7 @@ Context.prototype = {
|
|
|
132
132
|
var nodes = {};
|
|
133
133
|
while (i < source.length) {
|
|
134
134
|
i = this.until(['"', '}'], i);
|
|
135
|
-
if (at(source, i)
|
|
135
|
+
if (at(source, i) === '}' && !expectKeypair) {
|
|
136
136
|
i++;
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
@@ -148,10 +148,10 @@ Context.prototype = {
|
|
|
148
148
|
createProperty(object, key, result.value);
|
|
149
149
|
i = this.until([',', '}'], result.end);
|
|
150
150
|
var chr = at(source, i);
|
|
151
|
-
if (chr
|
|
151
|
+
if (chr === ',') {
|
|
152
152
|
expectKeypair = true;
|
|
153
153
|
i++;
|
|
154
|
-
} else if (chr
|
|
154
|
+
} else if (chr === '}') {
|
|
155
155
|
i++;
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
@@ -166,7 +166,7 @@ Context.prototype = {
|
|
|
166
166
|
var nodes = [];
|
|
167
167
|
while (i < source.length) {
|
|
168
168
|
i = this.skip(IS_WHITESPACE, i);
|
|
169
|
-
if (at(source, i)
|
|
169
|
+
if (at(source, i) === ']' && !expectElement) {
|
|
170
170
|
i++;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
@@ -174,10 +174,10 @@ Context.prototype = {
|
|
|
174
174
|
push(nodes, result);
|
|
175
175
|
push(array, result.value);
|
|
176
176
|
i = this.until([',', ']'], result.end);
|
|
177
|
-
if (at(source, i)
|
|
177
|
+
if (at(source, i) === ',') {
|
|
178
178
|
expectElement = true;
|
|
179
179
|
i++;
|
|
180
|
-
} else if (at(source, i)
|
|
180
|
+
} else if (at(source, i) === ']') {
|
|
181
181
|
i++;
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
@@ -193,17 +193,17 @@ Context.prototype = {
|
|
|
193
193
|
var source = this.source;
|
|
194
194
|
var startIndex = this.index;
|
|
195
195
|
var i = startIndex;
|
|
196
|
-
if (at(source, i)
|
|
197
|
-
if (at(source, i)
|
|
196
|
+
if (at(source, i) === '-') i++;
|
|
197
|
+
if (at(source, i) === '0') i++;
|
|
198
198
|
else if (exec(IS_NON_ZERO_DIGIT, at(source, i))) i = this.skip(IS_DIGIT, ++i);
|
|
199
199
|
else throw SyntaxError('Failed to parse number at: ' + i);
|
|
200
|
-
if (at(source, i)
|
|
201
|
-
if (at(source, i)
|
|
200
|
+
if (at(source, i) === '.') i = this.skip(IS_DIGIT, ++i);
|
|
201
|
+
if (at(source, i) === 'e' || at(source, i) === 'E') {
|
|
202
202
|
i++;
|
|
203
|
-
if (at(source, i)
|
|
203
|
+
if (at(source, i) === '+' || at(source, i) === '-') i++;
|
|
204
204
|
var exponentStartIndex = i;
|
|
205
205
|
i = this.skip(IS_DIGIT, i);
|
|
206
|
-
if (exponentStartIndex
|
|
206
|
+
if (exponentStartIndex === i) throw SyntaxError("Failed to parse number's exponent value at: " + i);
|
|
207
207
|
}
|
|
208
208
|
return this.node(PRIMITIVE, Number(slice(source, startIndex, i)), startIndex, i);
|
|
209
209
|
},
|
|
@@ -211,7 +211,7 @@ Context.prototype = {
|
|
|
211
211
|
var keyword = '' + value;
|
|
212
212
|
var index = this.index;
|
|
213
213
|
var endIndex = index + keyword.length;
|
|
214
|
-
if (slice(this.source, index, endIndex)
|
|
214
|
+
if (slice(this.source, index, endIndex) !== keyword) throw SyntaxError('Failed to parse value at: ' + index);
|
|
215
215
|
return this.node(PRIMITIVE, value, index, endIndex);
|
|
216
216
|
},
|
|
217
217
|
skip: function (regex, i) {
|
|
@@ -222,7 +222,7 @@ Context.prototype = {
|
|
|
222
222
|
until: function (array, i) {
|
|
223
223
|
i = this.skip(IS_WHITESPACE, i);
|
|
224
224
|
var chr = at(this.source, i);
|
|
225
|
-
for (var j = 0; j < array.length; j++) if (array[j]
|
|
225
|
+
for (var j = 0; j < array.length; j++) if (array[j] === chr) return i;
|
|
226
226
|
throw SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
|
|
227
227
|
}
|
|
228
228
|
};
|
|
@@ -36,7 +36,7 @@ var IS_WHITESPACE = /^[\t\n\r ]$/;
|
|
|
36
36
|
$({ target: 'JSON', stat: true, forced: !NATIVE_RAW_JSON }, {
|
|
37
37
|
rawJSON: function rawJSON(text) {
|
|
38
38
|
var jsonString = toString(text);
|
|
39
|
-
if (jsonString
|
|
39
|
+
if (jsonString === '' || exec(IS_WHITESPACE, at(jsonString, 0)) || exec(IS_WHITESPACE, at(jsonString, jsonString.length - 1))) {
|
|
40
40
|
throw $SyntaxError(ERROR_MESSAGE);
|
|
41
41
|
}
|
|
42
42
|
var parsed = parse(jsonString);
|
|
@@ -69,10 +69,10 @@ if ($stringify) $({ target: 'JSON', stat: true, arity: 3, forced: !NATIVE_RAW_JS
|
|
|
69
69
|
|
|
70
70
|
for (var i = 0; i < length; i++) {
|
|
71
71
|
var chr = at(json, i);
|
|
72
|
-
if (chr
|
|
72
|
+
if (chr === '"') {
|
|
73
73
|
var end = parseJSONString(json, ++i).end - 1;
|
|
74
74
|
var string = slice(json, i, end);
|
|
75
|
-
result += slice(string, 0, MARK_LENGTH)
|
|
75
|
+
result += slice(string, 0, MARK_LENGTH) === MARK
|
|
76
76
|
? rawStrings[slice(string, MARK_LENGTH)]
|
|
77
77
|
: '"' + string + '"';
|
|
78
78
|
i = end;
|
|
@@ -7,6 +7,6 @@ $({ target: 'Math', stat: true, forced: true }, {
|
|
|
7
7
|
signbit: function signbit(x) {
|
|
8
8
|
var n = +x;
|
|
9
9
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
10
|
-
return n
|
|
10
|
+
return n === n && n === 0 ? 1 / n === -Infinity : n < 0;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
@@ -23,7 +23,7 @@ $({ target: 'Number', stat: true, forced: true }, {
|
|
|
23
23
|
var R, mathNum;
|
|
24
24
|
if (typeof string != 'string') throw $TypeError(INVALID_NUMBER_REPRESENTATION);
|
|
25
25
|
if (!string.length) throw $SyntaxError(INVALID_NUMBER_REPRESENTATION);
|
|
26
|
-
if (charAt(string, 0)
|
|
26
|
+
if (charAt(string, 0) === '-') {
|
|
27
27
|
sign = -1;
|
|
28
28
|
string = stringSlice(string, 1);
|
|
29
29
|
if (!string.length) throw $SyntaxError(INVALID_NUMBER_REPRESENTATION);
|
|
@@ -6,7 +6,7 @@ var setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');
|
|
|
6
6
|
|
|
7
7
|
var INCORRECT = !setMethodAcceptSetLike('intersection') || fails(function () {
|
|
8
8
|
// eslint-disable-next-line es/no-array-from, es/no-set -- testing
|
|
9
|
-
return Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))
|
|
9
|
+
return Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2]))) !== '3,2';
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
// `Set.prototype.intersection` method
|