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

@ -4976,7 +4976,7 @@ export class Compiler extends DiagnosticEmitter {
let classType = contextualType.classReference;
if (
classType &&
classType.prototype == this.program.elementsLookup.get("Array")
classType.prototype == this.program.arrayPrototype
) {
return this.compileStaticArray(
assert(classType.typeArguments)[0],
@ -5137,7 +5137,7 @@ export class Compiler extends DiagnosticEmitter {
var module = this.module;
// obtain the array type
var arrayPrototype = assert(this.program.elementsLookup.get("Array"));
var arrayPrototype = assert(this.program.arrayPrototype);
if (!arrayPrototype || arrayPrototype.kind != ElementKind.CLASS_PROTOTYPE) return module.createUnreachable();
var arrayType = (<ClassPrototype>arrayPrototype).resolve([ elementType ]);
if (!arrayType) return module.createUnreachable();