parse-failure-1.js (486B)
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: If the parse fails, throw a SyntaxError exception (but see also clause 16) 5 esid: sec-performeval 6 es5id: 15.1.2.1_A2_T1 7 description: > 8 Checking if execution of "(0,eval)("x = 1; x\u000A++"), catch SyntaxError" 9 passes 10 ---*/ 11 12 var x; 13 assert.throws(SyntaxError, function() { 14 (0,eval)("x = 1; x\u000A++"); 15 }); 16 17 reportCompare(0, 0);