mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 15:37:52 +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, "ifne" );
|
||||||
addParam( list, script, "iflt" );
|
addParam( list, script, "iflt" );
|
||||||
addParam( list, script, "ifMultiple" );
|
addParam( list, script, "ifMultiple" );
|
||||||
|
addParam( list, script, "switchDirect" );
|
||||||
addParam( list, script, "forLoop" );
|
addParam( list, script, "forLoop" );
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
@ -98,6 +99,23 @@ public class ControlFlowOperators extends AbstractBaseTest {
|
|||||||
return condition;
|
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
|
@Export
|
||||||
static int forLoop() {
|
static int forLoop() {
|
||||||
int a = 0;
|
int a = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user