tor-browser

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

cptn-nrml-expr-prim.js (840B)


      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 normal and its completion value is a value V,
      7    then return the value V
      8 es5id: 15.1.2.1_A3.1_T1
      9 description: Expression statement. Eval return primitive value
     10 ---*/
     11 
     12 var x;
     13 //CHECK#1
     14 if (eval("x = 1") !== 1) {
     15  throw new Test262Error('#1: eval("x = 1") === 1. Actual: ' + (eval("x = 1")));
     16 }
     17 
     18 //CHECK#2
     19 if (eval("1") !== 1) {
     20  throw new Test262Error('#2: eval("1") === 1. Actual: ' + (eval("1")));
     21 }
     22 
     23 //CHECK#3
     24 if (eval("'1'") !== '1') {
     25  throw new Test262Error('#3: eval("\'1\'") === \'1\'. Actual: ' + (eval("'1'")));
     26 }
     27 
     28 //CHECK#4
     29 x = 1;
     30 if (eval("++x") !== 2) {
     31  throw new Test262Error('#4: x = 1; eval("++x") === 2. Actual: ' + (x));
     32 }
     33 
     34 reportCompare(0, 0);