Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed13aac

Browse filesBrowse files
mithunsasidharangibfahn
authored andcommitted
test: use Number.isNaN instead of global isNaN
PR-URL: #17515 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 964cebf commit ed13aac
Copy full SHA for ed13aac

File tree

Expand file treeCollapse file tree

3 files changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-os.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-os.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const { inspect } = require('util');
2828

2929
const is = {
3030
number: (value, key) => {
31-
assert(!isNaN(value), `${key} should not be NaN`);
31+
assert(!Number.isNaN(value), `${key} should not be NaN`);
3232
assert.strictEqual(typeof value, 'number');
3333
},
3434
string: (value) => { assert.strictEqual(typeof value, 'string'); },
Collapse file

‎test/parallel/test-readdouble.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readdouble.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ function test(clazz) {
7272
buffer[5] = 0xff;
7373
buffer[6] = 0x0f;
7474
buffer[7] = 0x00;
75-
assert.ok(isNaN(buffer.readDoubleBE(0)));
75+
assert.ok(Number.isNaN(buffer.readDoubleBE(0)));
7676
assert.strictEqual(2.225073858507201e-308, buffer.readDoubleLE(0));
7777

7878
buffer[6] = 0xef;
7979
buffer[7] = 0x7f;
80-
assert.ok(isNaN(buffer.readDoubleBE(0)));
80+
assert.ok(Number.isNaN(buffer.readDoubleBE(0)));
8181
assert.strictEqual(1.7976931348623157e+308, buffer.readDoubleLE(0));
8282

8383
buffer[0] = 0;
Collapse file

‎test/parallel/test-writefloat.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-writefloat.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ function test(clazz) {
127127
// Darwin ia32 does the other kind of NaN.
128128
// Compiler bug. No one really cares.
129129
assert(0x7F === buffer[7] || 0xFF === buffer[7]);
130-
assert.ok(isNaN(buffer.readFloatBE(0)));
131-
assert.ok(isNaN(buffer.readFloatLE(4)));
130+
assert.ok(Number.isNaN(buffer.readFloatBE(0)));
131+
assert.ok(Number.isNaN(buffer.readFloatLE(4)));
132132
}
133133

134134

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.