mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
first loop test
This commit is contained in:
parent
64fb45a6c5
commit
7c0e5d84fb
@ -45,6 +45,7 @@ public class ControlFlowOperators extends AbstractBaseTest {
|
||||
addParam( list, script, "ifMultiple" );
|
||||
addParam( list, script, "ifCompare" );
|
||||
addParam( list, script, "switchDirect" );
|
||||
addParam( list, script, "endlessLoop" );
|
||||
addParam( list, script, "forLoop" );
|
||||
}
|
||||
return list;
|
||||
@ -178,6 +179,20 @@ public class ControlFlowOperators extends AbstractBaseTest {
|
||||
return b;
|
||||
}
|
||||
|
||||
@Export
|
||||
static int endlessLoop() {
|
||||
int a = 0;
|
||||
int b = 0;
|
||||
do {
|
||||
if( a < 10 ) {
|
||||
b++;
|
||||
} else {
|
||||
return a;
|
||||
}
|
||||
a++;
|
||||
} while( true );
|
||||
}
|
||||
|
||||
@Export
|
||||
static int forLoop() {
|
||||
int a = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user