From 81f0d7d8ff5868cfccead774045dfb87405fddea Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 12 Sep 2014 01:44:30 +0100 Subject: [PATCH] use shim for Number.isNaN --- package.json | 1 + test/write.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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( -- 2.34.1