js/src/tests/test262/ch12/12.5/S12.5_A4.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     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  * When the production "IfStatement: if ( Expression ) Statement else Statement" is evaluated, Statement(s) is(are) evaluated second
     6  *
     7  * @path ch12/12.5/S12.5_A4.js
     8  * @description The first statement is "(function(){throw "instatement"})()"
     9  */
    11 //////////////////////////////////////////////////////////////////////////////
    12 //CHECK#1
    13 try {
    14 	if (true) (function(){throw "instatement"})();
    15 	$FAIL("#1 failed")
    16 } catch (e) {
    17 	if (e !== "instatement") {
    18 		$ERROR('#1: Exception === "instatement". Actual:  Exception ==='+ e);
    19 	}
    20 }
    21 //
    22 //////////////////////////////////////////////////////////////////////////////
    24 //////////////////////////////////////////////////////////////////////////////
    25 //CHECK#2
    26 try {
    27 	if (false) (function(){throw "truebranch"})(); (function(){throw "missbranch"})();
    28 	$FAIL("#2 failed")
    29 } catch (e) {
    30 	if (e !== "missbranch") {
    31 		$ERROR('#2: Exception === "missbranch". Actual:  Exception ==='+ e);
    32 	}
    33 }
    34 //
    35 //////////////////////////////////////////////////////////////////////////////

mercurial