Debian Codegraph @

js/src/tests/test262/language/statements/variable/S12.2_A6_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: VariableDeclaration within "try-catch" statement is allowed
6 es5id: 12.2_A6_T1
7 description: Declaring variable within "try-catch" statement
8 ---*/
9
10 //////////////////////////////////////////////////////////////////////////////
11 //CHECK#1
12 try{
13 intry__var=intry__var;
14 }catch(e){
15 throw new Test262Error('#1: Variable declaration inside "try" block is admitted');
16 };
17 //
18 //////////////////////////////////////////////////////////////////////////////
19
20 //////////////////////////////////////////////////////////////////////////////
21 //CHECK#2
22 try{
23 incatch__var=incatch__var;
24 }catch(e){
25 throw new Test262Error('#2: Variable declaration inside "catch" block is admitted');
26 };
27 //
28 //////////////////////////////////////////////////////////////////////////////
29
30 try{
31 var intry__var;
32 }catch(e){
33 var incatch__var;
34 };
35
36 reportCompare(0, 0);