]> zoso.dev Git - buffer.git/commitdiff
use shim for Number.isNaN
authorFeross Aboukhadijeh <feross@feross.org>
Fri, 12 Sep 2014 00:44:30 +0000 (01:44 +0100)
committerFeross Aboukhadijeh <feross@feross.org>
Fri, 12 Sep 2014 00:44:30 +0000 (01:44 +0100)
package.json
test/write.js

index a5fe7d622885d84830671db559226fdcbadf8665..db0af8331a0d4ec3f100750145e9bbd14b8bfc1a 100644 (file)
@@ -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",
index b98b81a91b3f09f2071856bd7c6e59fd73c6b428..5460246cd83e631d0792ef6de44ea9a25f6554d9 100644 (file)
@@ -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(