Fix an issue with 'super' not being present when inlining

This commit is contained in:
dcodeIO 2018-12-01 00:07:44 +01:00
parent 5c39043f9e
commit 9744c319c7

View File

@ -5410,11 +5410,27 @@ export class Compiler extends DiagnosticEmitter {
(<Class>parent).type,
"this"
);
let parentBase = (<Class>parent).base;
if (parentBase) {
flow.addScopedLocalAlias(
getGetLocalIndex(thisArg),
parentBase.type,
"super"
);
}
} else {
let thisLocal = flow.addScopedLocal((<Class>parent).type, "this", false);
body.push(
module.createSetLocal(thisLocal.index, thisArg)
);
let parentBase = (<Class>parent).base;
if (parentBase) {
flow.addScopedLocalAlias(
thisLocal.index,
parentBase.type,
"super"
);
}
}
}
var parameterTypes = signature.parameterTypes;