js/src/tests/test262/ch14/14.0/S14_A2.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 cannot be localed inside an Expression
     6  *
     7  * @path ch14/14.0/S14_A2.js
     8  * @description Declaring a function within an "if" Expression
     9  */
    11 //////////////////////////////////////////////////////////////////////////////
    12 //CHECK#1
    13 if (typeof f !== 'undefined') {
    14 	$ERROR('#1: typeof f === \'undefined\'. Actual:  typeof f ==='+ typeof f  );
    15 }
    16 //
    17 //////////////////////////////////////////////////////////////////////////////
    19 //////////////////////////////////////////////////////////////////////////////
    20 //CHECK#2
    21 if (function f(arg){
    22 	if (arg===0)
    23 	   return 1;
    24 	else
    25 	   return f(arg-1)*arg;
    26 }(3)!==6) {
    27 	$ERROR('#2: FunctionDeclaration cannot be localed inside an Expression');
    28 };
    29 //
    30 //////////////////////////////////////////////////////////////////////////////

mercurial