mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
test for empty catch block
This commit is contained in:
parent
06fc9dddfd
commit
2f1c0f0706
@ -46,6 +46,7 @@ public class Exceptions extends AbstractBaseTest {
|
||||
addParam( list, script, "rethrow" );
|
||||
addParam( list, script, "tryFinally" );
|
||||
addParam( list, script, "complex" );
|
||||
addParam( list, script, "emptyCatch" );
|
||||
}
|
||||
rule.setTestParameters( list );
|
||||
rule.setProperty( JWebAssembly.WASM_USE_EH, "true" );
|
||||
@ -132,6 +133,17 @@ public class Exceptions extends AbstractBaseTest {
|
||||
return v;
|
||||
}
|
||||
|
||||
@Export
|
||||
static int emptyCatch() {
|
||||
int h = 127; // variable slot 0
|
||||
try {
|
||||
int i = h + 1; // variable slot 1
|
||||
} catch( NumberFormatException nfe ) { // reuse variable slot 1
|
||||
// nothing
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
// @Export
|
||||
// static int multiCatch() {
|
||||
// int r;
|
||||
|
Loading…
x
Reference in New Issue
Block a user