mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-26 07:49:28 +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, "ifMultiple" );
|
||||||
addParam( list, script, "ifCompare" );
|
addParam( list, script, "ifCompare" );
|
||||||
addParam( list, script, "switchDirect" );
|
addParam( list, script, "switchDirect" );
|
||||||
|
addParam( list, script, "endlessLoop" );
|
||||||
addParam( list, script, "forLoop" );
|
addParam( list, script, "forLoop" );
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
@ -178,6 +179,20 @@ public class ControlFlowOperators extends AbstractBaseTest {
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Export
|
||||||
|
static int endlessLoop() {
|
||||||
|
int a = 0;
|
||||||
|
int b = 0;
|
||||||
|
do {
|
||||||
|
if( a < 10 ) {
|
||||||
|
b++;
|
||||||
|
} else {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
a++;
|
||||||
|
} while( true );
|
||||||
|
}
|
||||||
|
|
||||||
@Export
|
@Export
|
||||||
static int forLoop() {
|
static int forLoop() {
|
||||||
int a = 0;
|
int a = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user