Debian Codegraph @

js/src/tests/test262/language/eval-code/indirect/parse-failure-4.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 info: |
5 If Result(3).type is not normal, then Result(3).type must be throw.
6 Throw Result(3).value as an exception
7 esid: sec-performeval
8 es5id: 15.1.2.1_A3.3_T2
9 description: Break statement
10 ---*/
11
12 assert.throws(SyntaxError, function() {
13 (0,eval)("break;");
14 });
15
16 assert.throws(SyntaxError, function() {
17 for (var i = 0; i <= 1; i++) {
18 (0,eval)("break;");
19 throw new Test262Error("First iteration should not complete");
20 }
21 throw new Test262Error("Iteration should not complete");
22 });
23
24 reportCompare(0, 0);