js/src/tests/test262/ch12/12.13/S12.13_A3_T6.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Copyright 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * 1. Evaluate Expression
     6  *
     7  * @path ch12/12.13/S12.13_A3_T6.js
     8  * @description Evaluating functions
     9  */
    11 // CHECK#1
    12 var i=0;
    13 function adding1(){
    14   i++;
    15   return 1;
    16 }
    17 try{
    18   throw (adding1());
    19 }
    20 catch(e){
    21   if (e!==1) $ERROR('#1: Exception ===1. Actual:  Exception ==='+ e);
    22 }
    24 // CHECK#2
    25 var i=0;
    26 function adding2(){
    27   i++;
    28   return i;
    29 }
    30 try{
    31   throw adding2();
    32 }
    33 catch(e){}
    34 if (i!==1) $ERROR('#2: i===1. Actual: i==='+ i);
    36 // CHECK#3
    37 var i=0;
    38 function adding3(){
    39   i++;
    40 }
    41 try{
    42   throw adding3();
    43 }
    44 catch(e){}
    45 if (i!==1) $ERROR('#3: i===1. Actual: i==='+i);
    47 // CHECK#4
    48 function adding4(i){
    49   i++;
    50   return i;
    51 }
    52 try{
    53   throw (adding4(1));
    54 }
    55 catch(e){
    56   if (e!==2) $ERROR('#4: Exception ===2. Actual:  Exception ==='+ e);
    57 }

mercurial