From: Feross Aboukhadijeh Date: Tue, 1 Dec 2015 00:17:09 +0000 (-0800) Subject: fix test for IE8/9 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=09b3c545ad2fcc26f2815c208ebb1495c6e265a1;p=buffer.git fix test for IE8/9 --- diff --git a/test/basic.js b/test/basic.js index 20edcf0..d2fac76 100644 --- a/test/basic.js +++ b/test/basic.js @@ -71,17 +71,21 @@ test('storing negative number should cast to unsigned', function (t) { }) test('test that memory is copied from array-like', function (t) { - var u = new Uint8Array(4) - var b = new B(u) - b[0] = 1 - b[1] = 2 - b[2] = 3 - b[3] = 4 + if (B.TYPED_ARRAY_SUPPORT) { + var u = new Uint8Array(4) + var b = new B(u) + b[0] = 1 + b[1] = 2 + b[2] = 3 + b[3] = 4 - t.equal(u[0], 0) - t.equal(u[1], 0) - t.equal(u[2], 0) - t.equal(u[3], 0) + t.equal(u[0], 0) + t.equal(u[1], 0) + t.equal(u[2], 0) + t.equal(u[3], 0) + } else { + t.pass('object impl: skipping test') + } t.end() })