mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-10 21:07:52 -05:00
Only resolve 'arguments' and function/class expression names if the meaning permits it.
This commit is contained in:
@@ -422,27 +422,33 @@ module ts {
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
if (name === "arguments") {
|
||||
result = argumentsSymbol;
|
||||
break loop;
|
||||
if (meaning & SymbolFlags.Value) {
|
||||
if (name === "arguments") {
|
||||
result = argumentsSymbol;
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.FunctionExpression:
|
||||
if (name === "arguments") {
|
||||
result = argumentsSymbol;
|
||||
break loop;
|
||||
}
|
||||
let functionName = (<FunctionExpression>location).name;
|
||||
if (functionName && name === functionName.text) {
|
||||
result = location.symbol;
|
||||
break loop;
|
||||
if (meaning & SymbolFlags.Value) {
|
||||
if (name === "arguments") {
|
||||
result = argumentsSymbol;
|
||||
break loop;
|
||||
}
|
||||
let functionName = (<FunctionExpression>location).name;
|
||||
if (functionName && name === functionName.text) {
|
||||
result = location.symbol;
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.ClassExpression:
|
||||
let className = (<ClassExpression>location).name;
|
||||
if (className && name === className.text) {
|
||||
result = location.symbol;
|
||||
break loop;
|
||||
if (meaning & (SymbolFlags.Value | SymbolFlags.Type)) {
|
||||
let className = (<ClassExpression>location).name;
|
||||
if (className && name === className.text) {
|
||||
result = location.symbol;
|
||||
break loop;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.Decorator:
|
||||
|
||||
Reference in New Issue
Block a user