make ref_unlink optional and itcm pass a simple test again

note: there's no marking yet
This commit is contained in:
dcode
2019-03-29 18:56:32 +01:00
parent a3aa9a3961
commit 6a790321aa
15 changed files with 5445 additions and 89 deletions

View File

@ -850,9 +850,10 @@ export class Program extends DiagnosticEmitter {
if (element = this.lookupGlobal("__ref_link")) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.linkRef = this.resolver.resolveFunction(<FunctionPrototype>element, null);
element = assert(this.lookupGlobal("__ref_unlink"));
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.unlinkRef = this.resolver.resolveFunction(<FunctionPrototype>element, null);
if (element = this.lookupGlobal("__ref_unlink")) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.unlinkRef = this.resolver.resolveFunction(<FunctionPrototype>element, null);
}
} else if (element = this.lookupGlobal("__ref_retain")) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.retainRef = this.resolver.resolveFunction(<FunctionPrototype>element, null);