From: Feross Aboukhadijeh Date: Fri, 12 Sep 2014 00:44:30 +0000 (+0100) Subject: use shim for Number.isNaN X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=81f0d7d8ff5868cfccead774045dfb87405fddea;p=buffer.git use shim for Number.isNaN --- diff --git a/package.json b/package.json index a5fe7d6..db0af83 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "devDependencies": { "benchmark": "^1.0.0", "browserify": "^5.11.1", + "is-nan": "^1.0.1", "tape": "^2.14.0" }, "homepage": "https://github.com/feross/buffer", diff --git a/test/write.js b/test/write.js index b98b81a..5460246 100644 --- a/test/write.js +++ b/test/write.js @@ -1,5 +1,6 @@ var B = require('../').Buffer var test = require('tape') +var isnan = require('is-nan') if (process.env.OBJECT_IMPL) B.TYPED_ARRAY_SUPPORT = false test('buffer.write string should get parsed as number', function (t) { @@ -106,7 +107,7 @@ test('hex of write{Uint,Int}{8,16,32}{LE,BE} with overflow', function (t) { next.writeInt32BE(~0, 0) var readfn = 'read' + x + y + z var r = reads.shift() - if (Number.isNaN(r)) + if (isnan(r)) t.pass('equal') else t.equal(