|
1 // Copyright 2009 the Sputnik authors. All rights reserved. |
|
2 // This code is governed by the BSD license found in the LICENSE file. |
|
3 |
|
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 */ |
|
14 |
|
15 //CHECK#1 |
|
16 function f1(x){ |
|
17 return x; |
|
18 |
|
19 function x(){ |
|
20 return 7; |
|
21 } |
|
22 } |
|
23 if(!(f1().constructor.prototype === Function.prototype)){ |
|
24 $ERROR('#1: f1() returns function'); |
|
25 } |
|
26 |
|
27 //CHECK#2 |
|
28 function f2(x){ |
|
29 return typeof x; |
|
30 |
|
31 function x(){ |
|
32 return 7; |
|
33 } |
|
34 } |
|
35 if(!(f2() === "function")){ |
|
36 $ERROR('#2: f2() === "function"'); |
|
37 } |
|
38 |
|
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 } |
|
49 |