js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A4_T1.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  * Function declaration in function code - If the variable object
     6  * already has a property with the name of Function Identifier, replace its
     7  * value and attributes. Semantically, this step must follow the creation of
     8  * FormalParameterList properties
     9  *
    10  * @path ch10/10.2/10.2.1/S10.2.1_A4_T1.js
    11  * @description Checking existence of a function with passed parameter
    12  * @noStrict
    13  */
    15 //CHECK#1
    16 function f1(x){
    17   return x;
    19   function x(){
    20     return 7;
    21   }
    22 }
    23 if(!(f1().constructor.prototype === Function.prototype)){
    24   $ERROR('#1: f1() returns function');
    25 }
    27 //CHECK#2
    28 function f2(x){
    29   return typeof x;
    31   function x(){
    32     return 7;
    33   }
    34 }
    35 if(!(f2() === "function")){
    36   $ERROR('#2: f2() === "function"');
    37 }
    39 //CHECK#3
    40 function f3() {
    41   return typeof arguments;
    42   function arguments() {
    43     return 7;
    44   }
    45 }
    46 if (!(f3() === "function")){
    47   $ERROR('#3: f3() === "function"');
    48 }

mercurial