Skip to content

Commit 96411c7

Browse files
committed
Include a fix for AssemblyScript#176
1 parent a1b75b6 commit 96411c7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/compiler.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6575,12 +6575,13 @@ export class Compiler extends DiagnosticEmitter {
65756575

65766576
var expr: ExpressionRef;
65776577

6578-
// traverse to the first matching constructor
6578+
// traverse to the top-most visible constructor
65796579
var currentClassInstance: Class | null = classInstance;
6580-
var constructorInstance = classInstance.constructorInstance;
6581-
while (!constructorInstance && (currentClassInstance = classInstance.base)) {
6580+
var constructorInstance: Function | null = null;
6581+
do {
65826582
constructorInstance = currentClassInstance.constructorInstance;
6583-
}
6583+
if (constructorInstance) break; // TODO: check visibility
6584+
} while (currentClassInstance = currentClassInstance.base);
65846585

65856586
// if a constructor is present, call it with a zero `this`
65866587
if (constructorInstance) {

0 commit comments

Comments
 (0)