js/src/tests/test262/ch12/12.5/S12.5_A5.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  * FunctionDeclaration inside the "if" Expression is evaluated as true and function will not be declarated
     6  *
     7  * @path ch12/12.5/S12.5_A5.js
     8  * @description The "if" Expression is "function __func(){throw "FunctionExpression";}"
     9  */
    11 //////////////////////////////////////////////////////////////////////////////
    12 //CHECK#1
    13 try {
    14 	__func=__func;
    15 	$ERROR('#1: "__func=__func" lead to throwing exception');
    16 } catch (e) {
    17 	;
    18 }
    19 //
    20 //////////////////////////////////////////////////////////////////////////////
    23 //////////////////////////////////////////////////////////////////////////////
    24 //CHECK#2
    25 try {
    26 	if(function __func(){throw "FunctionExpression";}) (function(){throw "TrueBranch"})(); else (function(){"MissBranch"})();
    27 } catch (e) {
    28 	if (e !== "TrueBranch") {
    29 		$ERROR('#2: Exception ==="TrueBranch". Actual:  Exception ==='+ e);
    30 	}
    31 }
    32 //
    33 //////////////////////////////////////////////////////////////////////////////
    35 //////////////////////////////////////////////////////////////////////////////
    36 //CHECK#3
    37 try {
    38 	__func=__func;
    39 	$ERROR('#3: "__func=__func" lead to throwing exception');
    40 } catch (e) {
    41 	;
    42 }
    43 //
    44 //////////////////////////////////////////////////////////////////////////////

mercurial