tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

parse-failure-1.js (719B)


      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: If the parse fails, throw a SyntaxError exception (but see also clause 16)
      6 es5id: 15.1.2.1_A2_T1
      7 description: >
      8    Checking if execution of "eval("x = 1; x\u000A++"), catch
      9    SyntaxError" passes
     10 ---*/
     11 
     12 //CHECK#1
     13 var x;
     14 try {
     15  eval("x = 1; x\u000A++");
     16  throw new Test262Error('#1.1: eval("x = 1; x\\u000A++") must throw a SyntaxError. Actual: ' + (eval("x = 1; x\u000A++")));
     17 } catch (e) {
     18  if ((e instanceof SyntaxError) !== true) {
     19    throw new Test262Error('#1.2: eval("x = 1; x\\u000A++") must throw a SyntaxError. Actual: ' + (e));
     20  }  
     21 }
     22 
     23 reportCompare(0, 0);