Debian Codegraph @

js/src/tests/test262/language/eval-code/direct/parse-failure-4.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_T2
9 description: Break statement
10 ---*/
11
12 //CHECK#1
13 try {
14 eval("break;");
15 throw new Test262Error('#1.1: break must throw SyntaxError. Actual: ' + (eval("break;")));
16 } catch(e) {
17 if ((e instanceof SyntaxError) !== true) {
18 throw new Test262Error('#1.2: break must throw SyntaxError. Actual: ' + (e));
19 }
20 }
21
22 //CHECK#2
23 try {
24 for (var i = 0; i <= 1; i++) {
25 for (var j = 0; j <= 1; j++) {
26 eval("break;");
27 }
28 }
29 throw new Test262Error('#2.1: break must throw SyntaxError. Actual: ' + (eval("break;")));
30 } catch(e) {
31 if ((e instanceof SyntaxError) !== true) {
32 throw new Test262Error('#2.2: break must throw SyntaxError. Actual: ' + (e));
33 }
34 }
35
36 reportCompare(0, 0);