assemblyscript/tests/compiler/gc/global-init.ts

19 lines
387 B
TypeScript
Raw Normal View History

2019-04-06 20:17:48 +02:00
import "allocator/arena";
2019-03-27 14:43:35 +01:00
import { register_count, link_count, unlink_count } from "./_dummy";
@start export function main(): void {}
class Ref {}
// should register only
var global: Ref = new Ref();
assert(register_count == 1);
assert(link_count == 0);
assert(unlink_count == 0);
global = new Ref();
assert(register_count == 2);
assert(link_count == 0);
assert(unlink_count == 0);