mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 03:01:55 +00:00
Implicitly alias stdlib exports as program globals, see #8
This commit is contained in:
@ -5,12 +5,18 @@ export function ifThenElse(n: i32): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(ifThenElse(0) == false);
|
||||
assert(ifThenElse(1) == true);
|
||||
|
||||
export function ifThen(n: i32): bool {
|
||||
if (n)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(ifThen(0) == false);
|
||||
assert(ifThen(1) == true);
|
||||
|
||||
export function ifThenElseBlock(n: i32): bool {
|
||||
if (n) {
|
||||
; // nop
|
||||
@ -20,3 +26,6 @@ export function ifThenElseBlock(n: i32): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
assert(ifThenElseBlock(0) == false);
|
||||
assert(ifThenElseBlock(1) == true);
|
||||
|
Reference in New Issue
Block a user