buffer: remove obsolete NaN check

These two NaN entries are not necessary and we can safely remove them.

PR-URL: https://github.com/nodejs/node/pull/18744
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Ruben Bridgewater authored and Myles Borins committed 2018-02-21 14:20:28 -05:00
1 parent ed55374b98
commit f3ab106750
2 files changed
+5 -5

No files matched your search

+3
View File
@@ -148,3 +148,6 @@ b.writeDoubleBE(11.11, 0, true);
message: '"length" is outside of buffer bounds'
});
}
// Test an array like entry with the length set to NaN.
assert.deepStrictEqual(Buffer.from({ length: NaN }), Buffer.alloc(0));