Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
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_T2.js
11 * @description Checking existence of a function with declared variable
12 */
14 //CHECK#1
15 function f1(){
16 var x;
18 return x;
20 function x(){
21 return 7;
22 }
23 }
24 if(!(f1().constructor.prototype === Function.prototype)){
25 $PRINT('#1: f1() returns function');
26 }
28 //CHECK#2
29 function f2(){
30 var x;
32 return typeof x;
34 function x(){
35 return 7;
36 }
37 }
38 if(!(f2() === "function")){
39 $PRINT('#2: f2() === "function"');
40 }