Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18423 from amcasey/GH18188
Call getShorthandAssignmentValueSymbol rather than getSymbolAtLocation (cherry picked from commit aade971)
- Loading branch information
Showing
3 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
tests/baselines/reference/extractMethod/extractMethod29.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// ==ORIGINAL== | ||
interface UnaryExpression { | ||
kind: "Unary"; | ||
operator: string; | ||
operand: any; | ||
} | ||
|
||
function parseUnaryExpression(operator: string): UnaryExpression { | ||
return { | ||
kind: "Unary", | ||
operator, | ||
operand: parsePrimaryExpression(), | ||
}; | ||
} | ||
|
||
function parsePrimaryExpression(): any { | ||
throw "Not implemented"; | ||
} | ||
// ==SCOPE::function 'parseUnaryExpression'== | ||
interface UnaryExpression { | ||
kind: "Unary"; | ||
operator: string; | ||
operand: any; | ||
} | ||
|
||
function parseUnaryExpression(operator: string): UnaryExpression { | ||
return /*RENAME*/newFunction(); | ||
|
||
function newFunction() { | ||
return { | ||
kind: "Unary", | ||
operator, | ||
operand: parsePrimaryExpression(), | ||
}; | ||
} | ||
} | ||
|
||
function parsePrimaryExpression(): any { | ||
throw "Not implemented"; | ||
} | ||
// ==SCOPE::global scope== | ||
interface UnaryExpression { | ||
kind: "Unary"; | ||
operator: string; | ||
operand: any; | ||
} | ||
|
||
function parseUnaryExpression(operator: string): UnaryExpression { | ||
return /*RENAME*/newFunction(operator); | ||
} | ||
|
||
function newFunction(operator: string) { | ||
return { | ||
kind: "Unary", | ||
operator, | ||
operand: parsePrimaryExpression(), | ||
}; | ||
} | ||
|
||
function parsePrimaryExpression(): any { | ||
throw "Not implemented"; | ||
} |