aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/12_Statement/12.14_The_try_Statement/S12.14_A9_T1.js
blob: a0ed1d4fab4e6b0fc2a1e74eef8dce0bbabbccac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S12.14_A9_T1;
 * @section: 12.14;
 * @assertion: "try" with "catch" or "finally" statement within/without an "do while" statement;
 * @description: Loop within a "try" Block, from where exception is thrown;
 */


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S12.14_A9_T1",

path: "TestCases/12_Statement/12.14_The_try_Statement/S12.14_A9_T1.js",

assertion: "\"try\" with \"catch\" or \"finally\" statement within/without an \"do while\" statement",

description: "Loop within a \"try\" Block, from where exception is thrown",

test: function testcase() {
   // CHECK#1
var i=0;
try{
  do{
    if(i===5) throw i;
    i++;
  }
  while(i<10);
}
catch(e){
  if(e!==5)$ERROR('#1: Exception ===5. Actual:  Exception ==='+ e  );
}

 }
});