Debian Codegraph @

js/src/tests/test262/built-ins/ArrayBuffer/return-abrupt-from-length-symbol.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 Throws a TypeError if length is a symbol
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 features: [Symbol]
15 ---*/
16
17 var s = Symbol();
18
19 assert.throws(TypeError, function() {
20 new ArrayBuffer(s);
21 }, "`length` parameter is a Symbol");
22
23 reportCompare(0, 0);