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_T1.js michael@0: * @description Checking existence of a function with passed parameter michael@0: * @noStrict michael@0: */ michael@0: michael@0: //CHECK#1 michael@0: function f1(x){ 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: $ERROR('#1: f1() returns function'); michael@0: } michael@0: michael@0: //CHECK#2 michael@0: function f2(x){ 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: $ERROR('#2: f2() === "function"'); michael@0: } michael@0: michael@0: //CHECK#3 michael@0: function f3() { michael@0: return typeof arguments; michael@0: function arguments() { michael@0: return 7; michael@0: } michael@0: } michael@0: if (!(f3() === "function")){ michael@0: $ERROR('#3: f3() === "function"'); michael@0: } michael@0: