Skip to content

Commit

Permalink
Add test case for MatAtBread/nodent#109
Browse files Browse the repository at this point in the history
  • Loading branch information
MatAtBread committed Apr 30, 2018
1 parent 5bd015c commit 8e22f32
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions tests/semantics/try-catch-if.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
async function nop(x) { return x ; }

async function one() {
var z = 0;
try {
z = 1;
throw -1;
z = 2;
} catch (error) {
z = error;
if (true) {
await nop() ;
}
z = 6;
} finally {
z = 7;
}
return z;
}

async function two() {
var z = 0;
try {
z = 1;
throw -2;
z = 2;
} catch (error) {
z = error;
await nop() ;
z = 6;
} finally {
z = 7;
}
return z;
}

async function three() {
var z = 0;
try {
z = 1;
throw await nop(-3);
z = 2;
} catch (error) {
z = error;
if (true) {
await nop() ;
}
z = 6;
} finally {
z = 7;
}
return z;
}

return await one()*await two()*await three() ;

0 comments on commit 8e22f32

Please sign in to comment.