From 284710eaae1ff351ee93c1c957178bf22f59d452 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 9 Feb 2015 18:16:25 -0800 Subject: [PATCH] Fix iterator test for object implementation --- bin/download-node-tests.js | 13 +++++++++++-- test/node-test-buffer-iterator.js | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) 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'); -- 2.34.1