michael@0: // Copyright 2009 the Sputnik authors. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * Function declaration in function code - If the variable object michael@0: * already has a property with the name of Function Identifier, replace its michael@0: * value and attributes. Semantically, this step must follow the creation of michael@0: * FormalParameterList properties michael@0: * michael@0: * @path ch10/10.2/10.2.1/S10.2.1_A4_T2.js michael@0: * @description Checking existence of a function with declared variable michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: function f1(){ michael@0: var x; michael@0: michael@0: return x; michael@0: michael@0: function x(){ michael@0: return 7; michael@0: } michael@0: } michael@0: if(!(f1().constructor.prototype === Function.prototype)){ michael@0: $PRINT('#1: f1() returns function'); michael@0: } michael@0: michael@0: //CHECK#2 michael@0: function f2(){ michael@0: var x; michael@0: michael@0: return typeof x; michael@0: michael@0: function x(){ michael@0: return 7; michael@0: } michael@0: } michael@0: if(!(f2() === "function")){ michael@0: $PRINT('#2: f2() === "function"'); michael@0: } michael@0: