From 10d01249ccfbe8a95fa94223a44a03dde6e38417 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 20 Jan 2014 00:21:44 -0800 Subject: [PATCH] fix toArrayBuffer() test so it will run on Firefox --- test/basic.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/basic.js b/test/basic.js index 5a3f05e..1461e12 100644 --- a/test/basic.js +++ b/test/basic.js @@ -20,10 +20,10 @@ test('new buffer from string', function (t) { test('buffer toArrayBuffer()', function (t) { var data = [1, 2, 3, 4, 5, 6, 7, 8] - if (typeof (new B(data)).toArrayBuffer === 'function') { + if (typeof Uint8Array === 'function') { var result = new B(data).toArrayBuffer() var expected = new Uint8Array(data).buffer - for (var i = 0; i < expected.length; i++) { + for (var i = 0; i < expected.byteLength; i++) { t.equal(result[i], expected[i]) } } else { -- 2.34.1