Debian Codegraph @

js/src/tests/test262/language/statements/throw/S12.13_A2_T7.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 "throw Expression" returns (throw, GetValue(Result(1)), empty), where 1
7 evaluates Expression
8 es5id: 12.13_A2_T7
9 description: Throwing Array
10 ---*/
11
12 var mycars = new Array();
13 mycars[0] = "Saab";
14 mycars[1] = "Volvo";
15 mycars[2] = "BMW";
16
17 var mycars2 = new Array();
18 mycars2[0] = "Mercedes";
19 mycars2[1] = "Jeep";
20 mycars2[2] = "Suzuki";
21
22 // CHECK#1
23 try{
24 throw mycars;
25 }
26 catch(e){
27 for (var i=0;i<3;i++){
28 if (e[i]!==mycars[i]) throw new Test262Error('#1.'+i+': Exception['+i+'] === mycars['+i+']. Actual: Exception['+i+'] ==='+ e[i] );
29 }
30 }
31
32 reportCompare(0, 0);