Debian Codegraph @

js/src/tests/test262/built-ins/ArrayBuffer/undefined-newtarget-throws.js

raw
1 // Copyright (C) 2015 André Bargull. 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 ArrayBuffer is called as a function.
8 info: |
9 ArrayBuffer( length )
10
11 ArrayBuffer called with argument length performs the following steps:
12
13 1. If NewTarget is undefined, throw a TypeError exception.
14 ...
15 ---*/
16
17 assert.throws(TypeError, function() {
18 ArrayBuffer();
19 });
20
21 assert.throws(TypeError, function() {
22 ArrayBuffer(10);
23 });
24
25 reportCompare(0, 0);