Debian Codegraph @

js/src/tests/test262/language/function-code/S10.2.1_A4_T2.js

raw
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 info: |
6 Function declaration in function code - If the variable object
7 already has a property with the name of Function Identifier, replace its
8 value and attributes. Semantically, this step must follow the creation of
9 FormalParameterList properties
10 es5id: 10.2.1_A4_T2
11 description: Checking existence of a function with declared variable
12 ---*/
13
14 //CHECK#1
15 function f1(){
16 var x;
17
18 return x;
19
20 function x(){
21 return 7;
22 }
23 }
24
25 assert.sameValue(f1().constructor.prototype, Function.prototype);
26
27 //CHECK#2
28 function f2(){
29 var x;
30
31 return typeof x;
32
33 function x(){
34 return 7;
35 }
36 }
37
38 assert.sameValue(f2(), "function");
39
40 reportCompare(0, 0);