Skip to content

Commit 9294082

Browse files
committed
use self-compare NaN check
1 parent d8437f5 commit 9294082

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/core-js/modules/web.url-search-params.constructor.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ var TypeError = globalThis.TypeError;
4949
var encodeURIComponent = globalThis.encodeURIComponent;
5050
var fromCharCode = String.fromCharCode;
5151
var fromCodePoint = getBuiltIn('String', 'fromCodePoint');
52-
var $isNaN = isNaN;
5352
var $parseInt = parseInt;
5453
var charAt = uncurryThis(''.charAt);
5554
var join = uncurryThis([].join);
@@ -119,7 +118,8 @@ var decode = function (input) {
119118

120119
var octet = parseHexOctet(input, i + 1);
121120

122-
if ($isNaN(octet)) {
121+
// eslint-disable-next-line no-self-compare -- NaN check
122+
if (octet !== octet) {
123123
result += decodedChar;
124124
i++;
125125
continue;
@@ -146,7 +146,8 @@ var decode = function (input) {
146146

147147
var nextByte = parseHexOctet(input, i + 1);
148148

149-
if ($isNaN(nextByte)) {
149+
// eslint-disable-next-line no-self-compare -- NaN check
150+
if (nextByte !== nextByte) {
150151
i += 3;
151152
break;
152153
}

0 commit comments

Comments
 (0)