Debian Codegraph @

js/src/tests/test262/built-ins/ArrayBuffer/return-abrupt-from-length.js

raw
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 Return abrupt from ToIndex(length)
8 info: |
9 ArrayBuffer( length )
10
11 1. If NewTarget is undefined, throw a TypeError exception.
12 2. Let byteLength be ? ToIndex(length).
13 ...
14 ---*/
15
16 var len = {
17 valueOf: function() {
18 throw new Test262Error();
19 }
20 };
21
22 assert.throws(Test262Error, function() {
23 new ArrayBuffer(len);
24 });
25
26 reportCompare(0, 0);