Debian Codegraph @

js/src/tests/test262/language/eval-code/direct/cptn-thrw-prim.js

raw
1 // Copyright 2009 the Sputnik authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 info: |
6 If Result(3).type is not normal, then Result(3).type must be throw.
7 Throw Result(3).value as an exception
8 es5id: 15.1.2.1_A3.3_T4
9 description: Throw statement
10 ---*/
11
12 //CHECK#1
13 try {
14 eval("throw 1;");
15 throw new Test262Error('#1.1: throw 1 must throw SyntaxError. Actual: ' + (eval("throw 1;")));
16 } catch(e) {
17 if (e !== 1) {
18 throw new Test262Error('#1.2: throw 1 must throw SyntaxError. Actual: ' + (e));
19 }
20 }
21
22 reportCompare(0, 0);