Minor cleanup

This commit is contained in:
dcodeIO
2018-03-31 18:18:55 +02:00
parent 3d1f181961
commit 6ff69394f0
10 changed files with 65 additions and 40 deletions

View File

@ -192,14 +192,10 @@ export function compileCall(
compiler.currentType = Type.bool;
let classType = type.classReference;
if (classType) {
let stringPrototype = compiler.program.elementsLookup.get("String");
if (stringPrototype) {
assert(stringPrototype.kind == ElementKind.CLASS_PROTOTYPE);
let stringInstance = (<ClassPrototype>stringPrototype).resolve(null);
if (!stringInstance) return module.createUnreachable();
if (classType.isAssignableTo(stringInstance)) {
return module.createI32(1);
}
let stringInstance = compiler.program.stringInstance;
if (!stringInstance) return module.createUnreachable();
if (classType.isAssignableTo(stringInstance)) {
return module.createI32(1);
}
}
return module.createI32(0);