From: Feross Aboukhadijeh Date: Tue, 10 Feb 2015 02:16:25 +0000 (-0800) Subject: Fix iterator test for object implementation X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=284710eaae1ff351ee93c1c957178bf22f59d452;p=buffer.git Fix iterator test for object implementation --- diff --git a/bin/download-node-tests.js b/bin/download-node-tests.js index 241816b..b5a854c 100755 --- a/bin/download-node-tests.js +++ b/bin/download-node-tests.js @@ -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 } diff --git a/test/node-test-buffer-iterator.js b/test/node-test-buffer-iterator.js index 61399ad..972c7c6 100644 --- a/test/node-test-buffer-iterator.js +++ b/test/node-test-buffer-iterator.js @@ -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');