Skip to content

Commit

Permalink
[Test] ArrayBuffers in node < 0.12 have a nonconfigurable own `byteLe…
Browse files Browse the repository at this point in the history
…ngth` property
  • Loading branch information
ljharb committed Sep 22, 2021
1 parent bb65b07 commit 40f4b87
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions test/cmp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 40f4b87

Please sign in to comment.