Debian Codegraph @

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

raw
1 // |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally
2 // Copyright (C) 2016 The V8 Project authors. All rights reserved.
3 // Copyright (C) 2017 Mozilla Corporation. All rights reserved.
4 // This code is governed by the BSD license found in the LICENSE file.
5
6 /*---
7 esid: sec-sharedarraybuffer-length
8 description: >
9 Throws a TypeError if length is a symbol
10 info: |
11 SharedArrayBuffer( length )
12
13 1. If NewTarget is undefined, throw a TypeError exception.
14 2. Let byteLength be ? ToIndex(length).
15 ...
16 features: [SharedArrayBuffer, Symbol]
17 ---*/
18
19 var s = Symbol();
20
21 assert.throws(TypeError, function() {
22 new SharedArrayBuffer(s);
23 }, "`length` parameter is a Symbol");
24
25 reportCompare(0, 0);