Initial GC integration (#196)

This commit is contained in:
Daniel Wirtz
2018-08-02 18:23:02 +02:00
committed by GitHub
parent 671121bf70
commit dc0f271fc2
139 changed files with 7370 additions and 5016 deletions

View File

@ -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 };

View File

@ -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");