mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-15 16:01:30 +00:00
Initial GC integration (#196)
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import "allocator/arena";
|
||||
|
||||
export { memory };
|
||||
|
||||
export const COLOR: string = "red";
|
||||
|
||||
export function strlen(str: string): i32 {
|
||||
@ -14,7 +16,7 @@ export namespace math {
|
||||
|
||||
export class Car {
|
||||
static readonly MAX_DOORS: i32 = 5;
|
||||
static usualDoors: i32 = 3;
|
||||
static readonly usualDoors: i32 = 3;
|
||||
|
||||
numDoors: i32;
|
||||
private doorsOpen: bool = false;
|
||||
@ -42,5 +44,3 @@ export class Car {
|
||||
memory.free(changetype<usize>(this));
|
||||
}
|
||||
}
|
||||
|
||||
export { memory };
|
||||
|
Binary file not shown.
@ -23,6 +23,7 @@ assert(typeof proto.getString === "function");
|
||||
|
||||
// should export memory
|
||||
assert(module.memory instanceof WebAssembly.Memory);
|
||||
assert(typeof module.memory.free === "function");
|
||||
|
||||
// should be able to get an exported string
|
||||
assert.strictEqual(module.getString(module.COLOR), "red");
|
||||
|
Reference in New Issue
Block a user