mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
first switch test
This commit is contained in:
parent
3fa6f5670e
commit
903c2e0e28
@ -43,6 +43,7 @@ public class ControlFlowOperators extends AbstractBaseTest {
|
||||
addParam( list, script, "ifne" );
|
||||
addParam( list, script, "iflt" );
|
||||
addParam( list, script, "ifMultiple" );
|
||||
addParam( list, script, "switchDirect" );
|
||||
addParam( list, script, "forLoop" );
|
||||
}
|
||||
return list;
|
||||
@ -98,6 +99,23 @@ public class ControlFlowOperators extends AbstractBaseTest {
|
||||
return condition;
|
||||
}
|
||||
|
||||
@Export
|
||||
static int switchDirect() {
|
||||
return (switchDirect(10) * 10) + switchDirect( 9 );
|
||||
}
|
||||
|
||||
private static int switchDirect( int a ) {
|
||||
int b;
|
||||
switch(a){
|
||||
case 10:
|
||||
b = 1;
|
||||
break;
|
||||
default:
|
||||
b = 9;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@Export
|
||||
static int forLoop() {
|
||||
int a = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user