@@ -1440,8 +1440,10 @@ export class Resolver extends DiagnosticEmitter {
1440
1440
case ElementKind . InterfacePrototype :
1441
1441
case ElementKind . Class :
1442
1442
case ElementKind . Interface : {
1443
+ let classLikeTarget = target ;
1444
+ let findBase = false ;
1443
1445
do {
1444
- let member = target . getMember ( propertyName ) ;
1446
+ let member = classLikeTarget . getMember ( propertyName ) ;
1445
1447
if ( member ) {
1446
1448
if ( member . kind == ElementKind . PropertyPrototype ) {
1447
1449
let propertyInstance = this . resolveProperty ( < PropertyPrototype > member , reportMode ) ;
@@ -1458,34 +1460,32 @@ export class Resolver extends DiagnosticEmitter {
1458
1460
this . currentElementExpression = null ;
1459
1461
return member ; // instance FIELD, static GLOBAL, FUNCTION_PROTOTYPE, PROPERTY...
1460
1462
}
1461
- // traverse inherited static members on the base prototype if target is a class prototype
1462
- if (
1463
- target . kind == ElementKind . ClassPrototype ||
1464
- target . kind == ElementKind . InterfacePrototype
1465
- ) {
1466
- let classPrototype = < ClassPrototype > target ;
1467
- let basePrototype = classPrototype . basePrototype ;
1468
- if ( basePrototype ) {
1469
- target = basePrototype ;
1470
- } else {
1463
+ findBase = false ;
1464
+ switch ( classLikeTarget . kind ) {
1465
+ case ElementKind . ClassPrototype :
1466
+ case ElementKind . InterfacePrototype : {
1467
+ // traverse inherited static members on the base prototype if target is a class prototype
1468
+ let classPrototype = < ClassPrototype > classLikeTarget ;
1469
+ let basePrototype = classPrototype . basePrototype ;
1470
+ if ( basePrototype ) {
1471
+ findBase = true ;
1472
+ classLikeTarget = basePrototype ;
1473
+ }
1471
1474
break ;
1472
1475
}
1473
- // traverse inherited instance members on the base class if target is a class instance
1474
- } else if (
1475
- target . kind == ElementKind . Class ||
1476
- target . kind == ElementKind . Interface
1477
- ) {
1478
- let classInstance = < Class > target ;
1479
- let baseInstance = classInstance . base ;
1480
- if ( baseInstance ) {
1481
- target = baseInstance ;
1482
- } else {
1476
+ case ElementKind . Class :
1477
+ case ElementKind . Interface : {
1478
+ // traverse inherited instance members on the base class if target is a class instance
1479
+ let classInstance = < Class > classLikeTarget ;
1480
+ let baseInstance = classInstance . base ;
1481
+ if ( baseInstance ) {
1482
+ findBase = true ;
1483
+ classLikeTarget = baseInstance ;
1484
+ }
1483
1485
break ;
1484
1486
}
1485
- } else {
1486
- break ;
1487
1487
}
1488
- } while ( true ) ;
1488
+ } while ( findBase ) ;
1489
1489
break ;
1490
1490
}
1491
1491
default : { // enums or other namespace-like elements
0 commit comments