S10.2.1_A5.1_T2.js (771B)
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_T2 11 description: > 12 Checking existence of the variable object property with formal 13 parameter 14 ---*/ 15 16 //CHECK#1 17 function f1(x){ 18 var x; 19 20 return typeof x; 21 } 22 23 assert.sameValue(f1(), "undefined"); 24 25 //CHECK#2 26 function f2(x){ 27 var x; 28 29 return x; 30 } 31 32 assert.sameValue(f2(), undefined); 33 34 reportCompare(0, 0);