length-is-absent.js (533B)
1 // Copyright (C) 2016 The V8 Project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-arraybuffer-length 6 description: > 7 Returns an empty instance if length is absent 8 info: | 9 ArrayBuffer( length ) 10 11 1. If NewTarget is undefined, throw a TypeError exception. 12 2. Let byteLength be ? ToIndex(length). 13 3. Return ? AllocateArrayBuffer(NewTarget, byteLength). 14 ---*/ 15 16 var buffer = new ArrayBuffer(); 17 18 assert.sameValue(buffer.byteLength, 0); 19 20 reportCompare(0, 0);