File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -430,6 +430,14 @@ module ts {
430
430
}
431
431
}
432
432
433
+ export function getThisContainer ( node : Node ) : Node {
434
+ do {
435
+ node = getThisContainerOrArrowFunction ( node ) ;
436
+ } while ( node . kind === SyntaxKind . ArrowFunction ) ;
437
+
438
+ return node ;
439
+ }
440
+
433
441
export function hasRestParameters ( s : SignatureDeclaration ) : boolean {
434
442
return s . parameters . length > 0 && ( s . parameters [ s . parameters . length - 1 ] . flags & NodeFlags . Rest ) !== 0 ;
435
443
}
Original file line number Diff line number Diff line change @@ -2629,10 +2629,7 @@ module ts {
2629
2629
2630
2630
function getReferencesForThisKeyword ( thisKeyword : Node , sourceFiles : SourceFile [ ] ) {
2631
2631
// Get the owner" of the 'this' keyword.
2632
- var thisContainer = thisKeyword ;
2633
- do {
2634
- thisContainer = getThisContainerOrArrowFunction ( thisContainer ) ;
2635
- } while ( thisContainer . kind === SyntaxKind . ArrowFunction ) ;
2632
+ var thisContainer = getThisContainer ( thisKeyword ) ;
2636
2633
2637
2634
var searchSpaceNode : Node ;
2638
2635
@@ -2683,10 +2680,7 @@ module ts {
2683
2680
}
2684
2681
2685
2682
// Get the owner" of the 'this' keyword.
2686
- var container = node ;
2687
- do {
2688
- container = getThisContainerOrArrowFunction ( container ) ;
2689
- } while ( container . kind === SyntaxKind . ArrowFunction ) ;
2683
+ var container = getThisContainer ( node ) ;
2690
2684
2691
2685
switch ( container . kind ) {
2692
2686
case SyntaxKind . Property :
You can’t perform that action at this time.
0 commit comments