Skip to content

Commit

Permalink
enable eqeqeq, close #1225
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Aug 1, 2023
1 parent ea8404f commit bc87aae
Show file tree
Hide file tree
Showing 102 changed files with 340 additions and 331 deletions.
9 changes: 5 additions & 4 deletions packages/core-js-pure/override/internals/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var iterate = require('../internals/iterate');
var anInstance = require('../internals/an-instance');
var isCallable = require('../internals/is-callable');
var isObject = require('../internals/is-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var setToStringTag = require('../internals/set-to-string-tag');
var defineProperty = require('../internals/object-define-property').f;
var forEach = require('../internals/array-iteration').forEach;
Expand Down Expand Up @@ -38,19 +39,19 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
type: CONSTRUCTOR_NAME,
collection: new NativeConstructor()
});
if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
if (!isNullOrUndefined(iterable)) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
});

var Prototype = Constructor.prototype;

var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);

forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
var IS_ADDER = KEY == 'add' || KEY == 'set';
if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
var IS_ADDER = KEY === 'add' || KEY === 'set';
if (KEY in NativePrototype && !(IS_WEAK && KEY === 'clear')) {
createNonEnumerableProperty(Prototype, KEY, function (a, b) {
var collection = getInternalState(this).collection;
if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY === 'get' ? undefined : false;
var result = collection[KEY](a === 0 ? 0 : a, b);
return IS_ADDER ? this : result;
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js-pure/override/modules/es.date.to-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ $({ target: 'Date', proto: true, forced: FORCED }, {
var O = toObject(this);
var pv = toPrimitive(O, 'number');
return typeof pv == 'number' && !isFinite(pv) ? null :
(!('toISOString' in O) && classof(O) == 'Date') ? call(toISOString, O) : O.toISOString();
(!('toISOString' in O) && classof(O) === 'Date') ? call(toISOString, O) : O.toISOString();
}
});
2 changes: 1 addition & 1 deletion packages/core-js/internals/add-to-unscopables.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var ArrayPrototype = Array.prototype;

// Array.prototype[@@unscopables]
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
if (ArrayPrototype[UNSCOPABLES] == undefined) {
if (ArrayPrototype[UNSCOPABLES] === undefined) {
defineProperty(ArrayPrototype, UNSCOPABLES, {
configurable: true,
value: create(null)
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/array-buffer-byte-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ var $TypeError = TypeError;
// - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
// - If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
module.exports = uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) {
if (classof(O) != 'ArrayBuffer') throw $TypeError('ArrayBuffer expected');
if (classof(O) !== 'ArrayBuffer') throw $TypeError('ArrayBuffer expected');
return O.byteLength;
};
2 changes: 1 addition & 1 deletion packages/core-js/internals/array-buffer-transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = PROPER_TRANSFER && function (arrayBuffer, newLength, preserveRe
var fixedLength = !isResizable || !isResizable(arrayBuffer);
if (isDetached(arrayBuffer)) throw TypeError('ArrayBuffer is detached');
var newBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] });
if (byteLength == newByteLength && (preserveResizability || fixedLength)) return newBuffer;
if (byteLength === newByteLength && (preserveResizability || fixedLength)) return newBuffer;
if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) return slice(newBuffer, 0, newByteLength);
var options = (preserveResizability && !fixedLength) && maxByteLength ? { maxByteLength: maxByteLength(newBuffer) } : undefined;
var newNewBuffer = new ArrayBuffer(newByteLength, options);
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/array-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ if (!NATIVE_ARRAY_BUFFER) {
new NativeArrayBuffer();
new NativeArrayBuffer(1.5);
new NativeArrayBuffer(NaN);
return NativeArrayBuffer.length != 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
})) {
/* eslint-enable no-new -- required for testing */
$ArrayBuffer = function ArrayBuffer(length) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core-js/internals/array-includes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ var createMethod = function (IS_INCLUDES) {
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare -- NaN check
if (IS_INCLUDES && el != el) while (length > index) {
if (IS_INCLUDES && el !== el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare -- NaN check
if (value != value) return true;
if (value !== value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) {
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/array-iteration-from-last.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var lengthOfArrayLike = require('../internals/length-of-array-like');

// `Array.prototype.{ findLast, findLastIndex }` methods implementation
var createMethod = function (TYPE) {
var IS_FIND_LAST_INDEX = TYPE == 1;
var IS_FIND_LAST_INDEX = TYPE === 1;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IndexedObject(O);
Expand Down
14 changes: 7 additions & 7 deletions packages/core-js/internals/array-iteration.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ var push = uncurryThis([].push);

// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
var createMethod = function (TYPE) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var IS_FILTER_REJECT = TYPE == 7;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
var IS_MAP = TYPE === 1;
var IS_FILTER = TYPE === 2;
var IS_SOME = TYPE === 3;
var IS_EVERY = TYPE === 4;
var IS_FIND_INDEX = TYPE === 6;
var IS_FILTER_REJECT = TYPE === 7;
var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
return function ($this, callbackfn, that, specificCreate) {
var O = toObject($this);
var self = IndexedObject(O);
Expand Down
8 changes: 4 additions & 4 deletions packages/core-js/internals/async-iterator-iteration.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ var getIteratorDirect = require('../internals/get-iterator-direct');
var closeAsyncIteration = require('../internals/async-iterator-close');

var createMethod = function (TYPE) {
var IS_TO_ARRAY = TYPE == 0;
var IS_FOR_EACH = TYPE == 1;
var IS_EVERY = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_TO_ARRAY = TYPE === 0;
var IS_FOR_EACH = TYPE === 1;
var IS_EVERY = TYPE === 2;
var IS_SOME = TYPE === 3;
return function (object, fn, target) {
anObject(object);
var MAPPING = fn !== undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/caller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
module.exports = function (methodName, numArgs) {
return numArgs == 1 ? function (object, arg) {
return numArgs === 1 ? function (object, arg) {
return object[methodName](arg);
} : function (object, arg1, arg2) {
return object[methodName](arg1, arg2);
Expand Down
4 changes: 2 additions & 2 deletions packages/core-js/internals/classof.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var $Object = Object;

// ES3 wrong here
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';

// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
Expand All @@ -26,5 +26,5 @@ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
// builtinTag case
: CORRECT_ARGUMENTS ? classofRaw(O)
// ES3 arguments fallback
: (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
};
10 changes: 5 additions & 5 deletions packages/core-js/internals/collection-strong.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = {
if (index !== 'F') return state.index[index];
// frozen object case
for (entry = state.first; entry; entry = entry.next) {
if (entry.key == key) return entry;
if (entry.key === key) return entry;
}
};

Expand Down Expand Up @@ -106,8 +106,8 @@ module.exports = {
entry.removed = true;
if (prev) prev.next = next;
if (next) next.previous = prev;
if (state.first == entry) state.first = next;
if (state.last == entry) state.last = prev;
if (state.first === entry) state.first = next;
if (state.last === entry) state.last = prev;
if (DESCRIPTORS) state.size--;
else that.size--;
} return !!entry;
Expand Down Expand Up @@ -194,8 +194,8 @@ module.exports = {
return createIterResultObject(undefined, true);
}
// return step by kind
if (kind == 'keys') return createIterResultObject(entry.key, false);
if (kind == 'values') return createIterResultObject(entry.value, false);
if (kind === 'keys') return createIterResultObject(entry.key, false);
if (kind === 'values') return createIterResultObject(entry.value, false);
return createIterResultObject([entry.key, entry.value], false);
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);

Expand Down
12 changes: 6 additions & 6 deletions packages/core-js/internals/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
var fixMethod = function (KEY) {
var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);
defineBuiltIn(NativePrototype, KEY,
KEY == 'add' ? function add(value) {
KEY === 'add' ? function add(value) {
uncurriedNativeMethod(this, value === 0 ? 0 : value);
return this;
} : KEY == 'delete' ? function (key) {
} : KEY === 'delete' ? function (key) {
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : KEY == 'get' ? function get(key) {
} : KEY === 'get' ? function get(key) {
return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : KEY == 'has' ? function has(key) {
} : KEY === 'has' ? function has(key) {
return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : function set(key, value) {
uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
Expand All @@ -57,7 +57,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
} else if (isForced(CONSTRUCTOR_NAME, true)) {
var instance = new Constructor();
// early implementations not supports chaining
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
// V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
// most early implementations doesn't supports iterables, most modern - not close it correctly
Expand Down Expand Up @@ -96,7 +96,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
}

exported[CONSTRUCTOR_NAME] = Constructor;
$({ global: true, constructor: true, forced: Constructor != NativeConstructor }, exported);
$({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);

setToStringTag(Constructor, CONSTRUCTOR_NAME);

Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/date-to-iso-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
// https://tc39.es/ecma262/#sec-date.prototype.toisostring
// PhantomJS / old WebKit fails here:
module.exports = (fails(function () {
return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
return nativeDateToISOString.call(new Date(-5e13 - 1)) !== '0385-07-25T07:06:39.999Z';
}) || !fails(function () {
nativeDateToISOString.call(new Date(NaN));
})) ? function toISOString() {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/descriptors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ var fails = require('../internals/fails');
// Detect IE8's incomplete defineProperty implementation
module.exports = !fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
});
2 changes: 1 addition & 1 deletion packages/core-js/internals/engine-is-node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
var classof = require('../internals/classof-raw');

module.exports = typeof process != 'undefined' && classof(process) == 'process';
module.exports = typeof process != 'undefined' && classof(process) === 'process';
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
// String methods call symbol-named RegEp methods
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
return ''[KEY](O) !== 7;
});

var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/get-json-replacer-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function (replacer) {
for (var i = 0; i < rawLength; i++) {
var element = replacer[i];
if (typeof element == 'string') push(keys, element);
else if (typeof element == 'number' || classof(element) == 'Number' || classof(element) == 'String') push(keys, toString(element));
else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));
}
var keysLength = keys.length;
var root = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/get-set-record.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = function (obj) {
var numSize = +obj.size;
// NOTE: If size is undefined, then numSize will be NaN
// eslint-disable-next-line no-self-compare -- NaN check
if (numSize != numSize) throw $TypeError(INVALID_SIZE);
if (numSize !== numSize) throw $TypeError(INVALID_SIZE);
var intSize = toIntegerOrInfinity(numSize);
if (intSize < 0) throw $RangeError(INVALID_SIZE);
return new SetRecord(
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/global.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
var check = function (it) {
return it && it.Math == Math && it;
return it && it.Math === Math && it;
};

// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/host-report-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
module.exports = function (a, b) {
try {
// eslint-disable-next-line no-console -- safe
arguments.length == 1 ? console.error(a) : console.error(a, b);
arguments.length === 1 ? console.error(a) : console.error(a, b);
} catch (error) { /* empty */ }
};
2 changes: 1 addition & 1 deletion packages/core-js/internals/ie8-dom-define.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ module.exports = !DESCRIPTORS && !fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty(createElement('div'), 'a', {
get: function () { return 7; }
}).a != 7;
}).a !== 7;
});
4 changes: 2 additions & 2 deletions packages/core-js/internals/ieee754.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ var pack = function (number, mantissaLength, bytes) {
var exponent, mantissa, c;
number = abs(number);
// eslint-disable-next-line no-self-compare -- NaN check
if (number != number || number === Infinity) {
if (number !== number || number === Infinity) {
// eslint-disable-next-line no-self-compare -- NaN check
mantissa = number != number ? 1 : 0;
mantissa = number !== number ? 1 : 0;
exponent = eMax;
} else {
exponent = floor(log(number) / LN2);
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/indexed-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ module.exports = fails(function () {
// eslint-disable-next-line no-prototype-builtins -- safe
return !$Object('z').propertyIsEnumerable(0);
}) ? function (it) {
return classof(it) == 'String' ? split(it, '') : $Object(it);
return classof(it) === 'String' ? split(it, '') : $Object(it);
} : $Object;
2 changes: 1 addition & 1 deletion packages/core-js/internals/is-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ var classof = require('../internals/classof-raw');
// https://tc39.es/ecma262/#sec-isarray
// eslint-disable-next-line es/no-array-isarray -- safe
module.exports = Array.isArray || function isArray(argument) {
return classof(argument) == 'Array';
return classof(argument) === 'Array';
};
2 changes: 1 addition & 1 deletion packages/core-js/internals/is-big-int-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ var classof = require('../internals/classof');

module.exports = function (it) {
var klass = classof(it);
return klass == 'BigInt64Array' || klass == 'BigUint64Array';
return klass === 'BigInt64Array' || klass === 'BigUint64Array';
};
4 changes: 2 additions & 2 deletions packages/core-js/internals/is-forced.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var replacement = /#|\.prototype\./;

var isForced = function (feature, detection) {
var value = data[normalize(feature)];
return value == POLYFILL ? true
: value == NATIVE ? false
return value === POLYFILL ? true
: value === NATIVE ? false
: isCallable(detection) ? fails(detection)
: !!detection;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/is-regexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ var MATCH = wellKnownSymbol('match');
// https://tc39.es/ecma262/#sec-isregexp
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
};
4 changes: 2 additions & 2 deletions packages/core-js/internals/iterator-define.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
|| IterablePrototype['@@iterator']
|| DEFAULT && IterablePrototype[DEFAULT];
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
var CurrentIteratorPrototype, methods, KEY;

// fix native
Expand All @@ -66,7 +66,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
}

// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
} else {
Expand Down
4 changes: 2 additions & 2 deletions packages/core-js/internals/math-expm1.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = (!$expm1
// Old FF bug
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
// Tor Browser bug
|| $expm1(-2e-17) != -2e-17
|| $expm1(-2e-17) !== -2e-17
) ? function expm1(x) {
var n = +x;
return n == 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
return n === 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
} : $expm1;
2 changes: 1 addition & 1 deletion packages/core-js/internals/math-fround.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ module.exports = Math.fround || function fround(x) {
a = (1 + EPSILON32 / EPSILON) * $abs;
result = a - (a - $abs);
// eslint-disable-next-line no-self-compare -- NaN check
if (result > MAX32 || result != result) return $sign * Infinity;
if (result > MAX32 || result !== result) return $sign * Infinity;
return $sign * result;
};
2 changes: 1 addition & 1 deletion packages/core-js/internals/math-scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh)
var nOutLow = +outLow;
var nOutHigh = +outHigh;
// eslint-disable-next-line no-self-compare -- NaN check
if (nx != nx || nInLow != nInLow || nInHigh != nInHigh || nOutLow != nOutLow || nOutHigh != nOutHigh) return NaN;
if (nx !== nx || nInLow !== nInLow || nInHigh !== nInHigh || nOutLow !== nOutLow || nOutHigh !== nOutHigh) return NaN;
if (nx === Infinity || nx === -Infinity) return nx;
return (nx - nInLow) * (nOutHigh - nOutLow) / (nInHigh - nInLow) + nOutLow;
};
Loading

0 comments on commit bc87aae

Please sign in to comment.