js/src/tests/test262/ch13/13.0/S13_A17_T1.js

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

     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  * Function call cannot appear in the program before the FunctionExpression appears
     6  *
     7  * @path ch13/13.0/S13_A17_T1.js
     8  * @description Trying to call a function before the FunctionExpression appears
     9  */
    11 //////////////////////////////////////////////////////////////////////////////
    12 //CHECK#1
    13 try{
    14     var __result = __func();
    15 	$FAIL("#1.1: var __result = __func() lead to throwing exception");
    16 } catch(e) {
    17   if ((e instanceof TypeError) !== true) {
    18     $ERROR('#1.2: func should throw a TypeError  Actual: ' + (e));  
    19   }
    20 }
    21 //
    22 //////////////////////////////////////////////////////////////////////////////
    24 var __func = function (){return "ONE";};
    26 //////////////////////////////////////////////////////////////////////////////
    27 //CHECK#2
    28 var __result = __func();
    29 if (__result !== "ONE") {
    30 	$ERROR('#2: __result === "ONE". Actual: __result ==='+__result);
    31 }
    32 //
    33 //////////////////////////////////////////////////////////////////////////////
    35 __func = function (){return "TWO";};
    37 //////////////////////////////////////////////////////////////////////////////
    38 //CHECK#3
    39 var __result = __func();
    40 if (__result !== "TWO") {
    41 	$ERROR('#3: __result === "TWO". Actual: __result ==='+__result);
    42 }
    43 //
    44 //////////////////////////////////////////////////////////////////////////////

mercurial