mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #5139 from Microsoft/getBlockScopedVariableIdIsNoMore
[cleanup] remove unused function from the EmitResolver
This commit is contained in:
@@ -14764,31 +14764,6 @@ namespace ts {
|
||||
return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration;
|
||||
}
|
||||
|
||||
function getBlockScopedVariableId(n: Identifier): number {
|
||||
Debug.assert(!nodeIsSynthesized(n));
|
||||
|
||||
let isVariableDeclarationOrBindingElement =
|
||||
n.parent.kind === SyntaxKind.BindingElement || (n.parent.kind === SyntaxKind.VariableDeclaration && (<VariableDeclaration>n.parent).name === n);
|
||||
|
||||
let symbol =
|
||||
(isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) ||
|
||||
getNodeLinks(n).resolvedSymbol ||
|
||||
resolveName(n, n.text, SymbolFlags.Value | SymbolFlags.Alias, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
|
||||
|
||||
let isLetOrConst =
|
||||
symbol &&
|
||||
(symbol.flags & SymbolFlags.BlockScopedVariable) &&
|
||||
symbol.valueDeclaration.parent.kind !== SyntaxKind.CatchClause;
|
||||
|
||||
if (isLetOrConst) {
|
||||
// side-effect of calling this method:
|
||||
// assign id to symbol if it was not yet set
|
||||
getSymbolLinks(symbol);
|
||||
return symbol.id;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function instantiateSingleCallFunctionType(functionType: Type, typeArguments: Type[]): Type {
|
||||
if (functionType === unknownType) {
|
||||
return unknownType;
|
||||
@@ -14823,7 +14798,6 @@ namespace ts {
|
||||
isEntityNameVisible,
|
||||
getConstantValue,
|
||||
collectLinkedAliases,
|
||||
getBlockScopedVariableId,
|
||||
getReferencedValueDeclaration,
|
||||
getTypeReferenceSerializationKind,
|
||||
isOptionalParameter
|
||||
|
||||
@@ -1598,7 +1598,6 @@ namespace ts {
|
||||
isEntityNameVisible(entityName: EntityName | Expression, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
// Returns the constant value this property access resolves to, or 'undefined' for a non-constant
|
||||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
getReferencedValueDeclaration(reference: Identifier): Declaration;
|
||||
getTypeReferenceSerializationKind(typeName: EntityName): TypeReferenceSerializationKind;
|
||||
isOptionalParameter(node: ParameterDeclaration): boolean;
|
||||
|
||||
Reference in New Issue
Block a user