]> zoso.dev Git - buffer.git/commitdiff
fix tests for ie6+7: fix use of JSON object
authorFeross Aboukhadijeh <feross@feross.org>
Tue, 22 Jul 2014 06:04:31 +0000 (23:04 -0700)
committerFeross Aboukhadijeh <feross@feross.org>
Tue, 22 Jul 2014 06:04:31 +0000 (23:04 -0700)
test/basic.js

index a24986b88c24ad7a77c61c92c9fe99cf8b11c281..2f79d19a3d3daa3c1b5d51f2cd5ac2bdd47cb23a 100644 (file)
@@ -162,6 +162,11 @@ test('buffer toJSON()', function (t) {
 })
 
 test('new buffer from buffer.toJSON() output', function (t) {
+  if (typeof JSON === 'undefined') {
+    // ie6, ie7 lack support
+    t.end()
+    return
+  }
   var buf = new B('test')
   var json = JSON.stringify(buf)
   var obj = JSON.parse(json)