Debian Codegraph @

js/src/tests/test262/harness/assert-throws-no-arg.js

raw
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 The assertion fails when invoked without arguments.
7 ---*/
8
9 var threw = false;
10
11 try {
12 assert.throws();
13 } catch(err) {
14 threw = true;
15 if (err.constructor !== Test262Error) {
16 throw new Error(
17 'Expected a Test262Error, but a "' + err.constructor.name +
18 '" was thrown.'
19 );
20 }
21 }
22
23 if (threw === false) {
24 throw new Error('Expected a Test262Error, but no error was thrown.');
25 }
26
27 reportCompare(0, 0);