Debian Codegraph @

js/src/tests/test262/language/function-code/S10.2.1_A5.1_T1.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 For each VariableDeclaration or VariableDeclarationNoIn in the
7 code, create a property of the variable object whose name is the Identifier
8 in the VariableDeclaration or VariableDeclarationNoIn, whose value is
9 undefined and whose attributes are determined by the type of code
10 es5id: 10.2.1_A5.1_T1
11 description: Checking variable existence only
12 ---*/
13
14 //CHECK#1
15 function f1(){
16 var x;
17
18 return typeof x;
19 }
20
21 assert.sameValue(f1(), "undefined");
22
23 //CHECK#2
24 function f2(){
25 var x;
26
27 return x;
28 }
29
30 assert.sameValue(f2(), undefined);
31
32 reportCompare(0, 0);