@@ -15048,6 +15048,52 @@ var es2024 = function ES2024(ES, ops, expectedMissing, skips) {
15048
15048
t.end();
15049
15049
});
15050
15050
15051
+ test('ArrayBufferByteLength', function (t) {
15052
+ var order = 'UNORDERED';
15053
+
15054
+ forEach([].concat(
15055
+ v.primitives,
15056
+ v.objects
15057
+ ), function (nonAB) {
15058
+ t['throws'](
15059
+ function () { ES.ArrayBufferByteLength(nonAB, order); },
15060
+ TypeError,
15061
+ debug(nonAB) + ' is not an ArrayBuffer'
15062
+ );
15063
+ });
15064
+
15065
+ t.test('ArrayBuffers supported', { skip: typeof ArrayBuffer !== 'function' }, function (st) {
15066
+ var ab = new ArrayBuffer(8);
15067
+ st['throws'](
15068
+ function () { ES.ArrayBufferByteLength(ab, 'not a valid order'); },
15069
+ TypeError,
15070
+ 'invalid order enum value throws'
15071
+ );
15072
+
15073
+ st.equal(ES.ArrayBufferByteLength(ab, order), 8, 'fixed length ArrayBuffer is fixed length');
15074
+
15075
+ st.end();
15076
+ });
15077
+
15078
+ t.test('SharedArrayBuffers supported', { skip: typeof SharedArrayBuffer !== 'function' }, function (st) {
15079
+ var sab = new SharedArrayBuffer(1);
15080
+ st.equal(ES.ArrayBufferByteLength(sab, order), 1, 'fixed length SharedArrayBuffer is fixed length');
15081
+
15082
+ st.test('growable SABs', { skip: !('grow' in SharedArrayBuffer.prototype) }, function (s2t) {
15083
+ var gsab = new SharedArrayBuffer(0, { maxByteLength: 64 });
15084
+ s2t.equal(ES.ArrayBufferByteLength(gsab, order), 0, 'growable SharedArrayBuffer has initial length');
15085
+
15086
+ gsab.grow(8);
15087
+
15088
+ s2t.equal(ES.ArrayBufferByteLength(gsab, order), 8, 'growable SharedArrayBuffer has initial length');
15089
+
15090
+ s2t.end();
15091
+ });
15092
+
15093
+ st.end();
15094
+ });
15095
+ });
15096
+
15051
15097
test('ArrayBufferCopyAndDetach', function (t) {
15052
15098
forEach([].concat(
15053
15099
v.primitives,
0 commit comments