]> zoso.dev Git - buffer.git/commitdiff
Fix iterator test for object implementation
authorFeross Aboukhadijeh <feross@feross.org>
Tue, 10 Feb 2015 02:16:25 +0000 (18:16 -0800)
committerFeross Aboukhadijeh <feross@feross.org>
Tue, 10 Feb 2015 02:16:25 +0000 (18:16 -0800)
bin/download-node-tests.js
test/node-test-buffer-iterator.js

index 241816b3577565efee1551139414dbaebdd5ab9e..b5a854cc4634d20a526576151d4fc893be650992 100755 (executable)
@@ -48,10 +48,19 @@ function testfixer (filename) {
     line = line.toString()
 
     if (firstline) {
+      var originalLine = line
       // require buffer explicitly
-      line = 'var Buffer = require(\'../\').Buffer\n' +
-             'if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false\n' + line
+      line = 'var Buffer = require(\'../\').Buffer\n'
 
+      // don't run this test for the Object-based bufer implementation because
+      // it doesn't have an Iterable interface (but these old browsers won't have it
+      // anyway)
+      if (filename === 'test-buffer-iterator.js')
+        line += 'if (process.env.OBJECT_IMPL) return\n'
+      else
+        line += 'if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false\n'
+
+      line += originalLine
       firstline = false
     }
 
index 61399adcd31645307e3e1151c4c0017350cfc3fe..972c7c6c8a6bc890e19808ca88229d41b8dd4058 100644 (file)
@@ -1,5 +1,5 @@
 var Buffer = require('../').Buffer
-if (process.env.OBJECT_IMPL) Buffer.TYPED_ARRAY_SUPPORT = false
+if (process.env.OBJECT_IMPL) return
 // var common = require('../common');
 var assert = require('assert');