Made a getThisContainer function.
This commit is contained in:
parent
a6a6d77d4a
commit
84e385ddfa
|
@ -430,6 +430,14 @@ module ts {
|
|||
}
|
||||
}
|
||||
|
||||
export function getThisContainer(node: Node): Node {
|
||||
do {
|
||||
node = getThisContainerOrArrowFunction(node);
|
||||
} while (node.kind === SyntaxKind.ArrowFunction);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
export function hasRestParameters(s: SignatureDeclaration): boolean {
|
||||
return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & NodeFlags.Rest) !== 0;
|
||||
}
|
||||
|
|
|
@ -2629,10 +2629,7 @@ module ts {
|
|||
|
||||
function getReferencesForThisKeyword(thisKeyword: Node, sourceFiles: SourceFile[]) {
|
||||
// Get the owner" of the 'this' keyword.
|
||||
var thisContainer = thisKeyword;
|
||||
do {
|
||||
thisContainer = getThisContainerOrArrowFunction(thisContainer);
|
||||
} while (thisContainer.kind === SyntaxKind.ArrowFunction);
|
||||
var thisContainer = getThisContainer(thisKeyword);
|
||||
|
||||
var searchSpaceNode: Node;
|
||||
|
||||
|
@ -2683,10 +2680,7 @@ module ts {
|
|||
}
|
||||
|
||||
// Get the owner" of the 'this' keyword.
|
||||
var container = node;
|
||||
do {
|
||||
container = getThisContainerOrArrowFunction(container);
|
||||
} while (container.kind === SyntaxKind.ArrowFunction);
|
||||
var container = getThisContainer(node);
|
||||
|
||||
switch (container.kind) {
|
||||
case SyntaxKind.Property:
|
||||
|
|
Loading…
Reference in a new issue