Debian Codegraph @

js/src/tests/test262/language/statements/variable/S12.2_A5.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 VariableDeclaration within Eval statement is initialized as the program
7 reaches the eval statement
8 es5id: 12.2_A5
9 description: Executing eval("var x")
10 flags: [noStrict]
11 ---*/
12
13 //////////////////////////////////////////////////////////////////////////////
14 //CHECK#1
15 assert.throws(ReferenceError, function() {
16 x=x;
17 });
18 //
19 //////////////////////////////////////////////////////////////////////////////
20
21 eval("var x");
22
23 //////////////////////////////////////////////////////////////////////////////
24 //CHECK#2
25 try{
26 x=x;
27 }catch(e){
28 throw new Test262Error('#2: VariableDeclaration inside Eval statement is initialized when program reaches the eval statement '+e.message);
29 };
30 //
31 //////////////////////////////////////////////////////////////////////////////
32
33 reportCompare(0, 0);