From 40f4b8719658f6262399b24791d4ccb5960ca8ea Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 22 Sep 2021 13:50:32 -0700 Subject: [PATCH] [Test] ArrayBuffers in node < 0.12 have a nonconfigurable own `byteLength` property --- test/cmp.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/test/cmp.js b/test/cmp.js index e61237e..721a422 100644 --- a/test/cmp.js +++ b/test/cmp.js @@ -1218,16 +1218,20 @@ test('TypedArrays', { skip: !hasTypedArrays }, function (t) { false ); - var empty4 = new ArrayBuffer(4); - var empty6 = new ArrayBuffer(6); - Object.defineProperty(empty6, 'byteLength', { value: 4 }); - st.deepEqualTest( - empty4, - empty6, - 'different-length ArrayBuffers, one lying', - false, - false - ); + t.test('lies about byteLength', { skip: !('byteLength' in ArrayBuffer.prototype) }, function (s2t) { + var empty4 = new ArrayBuffer(4); + var empty6 = new ArrayBuffer(6); + Object.defineProperty(empty6, 'byteLength', { value: 4 }); + + s2t.deepEqualTest( + empty4, + empty6, + 'different-length ArrayBuffers, one lying', + false, + false + ); + s2t.end(); + }); st.end(); });