Refactor using short-hand
This commit is contained in:
parent
2a3c4ea3c2
commit
8df64293f9
|
@ -75,43 +75,43 @@ module ts {
|
|||
|
||||
var checker: TypeChecker = {
|
||||
getProgram: () => program,
|
||||
getDiagnostics: getDiagnostics,
|
||||
getGlobalDiagnostics: getGlobalDiagnostics,
|
||||
getNodeCount: () => sum(program.getSourceFiles(), "nodeCount"),
|
||||
getIdentifierCount: () => sum(program.getSourceFiles(), "identifierCount"),
|
||||
getSymbolCount: () => sum(program.getSourceFiles(), "symbolCount"),
|
||||
getTypeCount: () => typeCount,
|
||||
checkProgram: checkProgram,
|
||||
emitFiles: invokeEmitter,
|
||||
getParentOfSymbol: getParentOfSymbol,
|
||||
getNarrowedTypeOfSymbol: getNarrowedTypeOfSymbol,
|
||||
getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol,
|
||||
getPropertiesOfType: getPropertiesOfType,
|
||||
getPropertyOfType: getPropertyOfType,
|
||||
getSignaturesOfType: getSignaturesOfType,
|
||||
getIndexTypeOfType: getIndexTypeOfType,
|
||||
getReturnTypeOfSignature: getReturnTypeOfSignature,
|
||||
getSymbolsInScope: getSymbolsInScope,
|
||||
getSymbolInfo: getSymbolInfo,
|
||||
getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol,
|
||||
getTypeOfNode: getTypeOfNode,
|
||||
typeToString: typeToString,
|
||||
getSymbolDisplayBuilder: getSymbolDisplayBuilder,
|
||||
symbolToString: symbolToString,
|
||||
getAugmentedPropertiesOfType: getAugmentedPropertiesOfType,
|
||||
getRootSymbols: getRootSymbols,
|
||||
getContextualType: getContextualType,
|
||||
getFullyQualifiedName: getFullyQualifiedName,
|
||||
getResolvedSignature: getResolvedSignature,
|
||||
getEnumMemberValue: getEnumMemberValue,
|
||||
isValidPropertyAccess: isValidPropertyAccess,
|
||||
getSignatureFromDeclaration: getSignatureFromDeclaration,
|
||||
isImplementationOfOverload: isImplementationOfOverload,
|
||||
getAliasedSymbol: resolveImport,
|
||||
isUndefinedSymbol: symbol => symbol === undefinedSymbol,
|
||||
isArgumentsSymbol: symbol => symbol === argumentsSymbol,
|
||||
hasEarlyErrors: hasEarlyErrors,
|
||||
isEmitBlocked: isEmitBlocked
|
||||
getDiagnostics,
|
||||
getGlobalDiagnostics,
|
||||
checkProgram,
|
||||
invokeEmitter,
|
||||
getParentOfSymbol,
|
||||
getNarrowedTypeOfSymbol,
|
||||
getDeclaredTypeOfSymbol,
|
||||
getPropertiesOfType,
|
||||
getPropertyOfType,
|
||||
getSignaturesOfType,
|
||||
getIndexTypeOfType,
|
||||
getReturnTypeOfSignature,
|
||||
getSymbolsInScope,
|
||||
getSymbolInfo,
|
||||
getShorthandAssignmentValueSymbol,
|
||||
getTypeOfNode,
|
||||
typeToString,
|
||||
getSymbolDisplayBuilder,
|
||||
symbolToString,
|
||||
getAugmentedPropertiesOfType,
|
||||
getRootSymbols,
|
||||
getContextualType,
|
||||
getFullyQualifiedName,
|
||||
getResolvedSignature,
|
||||
getEnumMemberValue,
|
||||
isValidPropertyAccess,
|
||||
getSignatureFromDeclaration,
|
||||
isImplementationOfOverload,
|
||||
getAliasedSymbol: resolveImport,
|
||||
hasEarlyErrors,
|
||||
isEmitBlocked,
|
||||
};
|
||||
|
||||
var undefinedSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient, "undefined");
|
||||
|
@ -953,7 +953,7 @@ module ts {
|
|||
if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) {
|
||||
return undefined;
|
||||
}
|
||||
return { aliasesToMakeVisible: aliasesToMakeVisible };
|
||||
return { aliasesToMakeVisible };
|
||||
|
||||
function getIsDeclarationVisible(declaration: Declaration) {
|
||||
if (!isDeclarationVisible(declaration)) {
|
||||
|
@ -9118,22 +9118,22 @@ module ts {
|
|||
function invokeEmitter(targetSourceFile?: SourceFile) {
|
||||
var resolver: EmitResolver = {
|
||||
getProgram: () => program,
|
||||
getLocalNameOfContainer: getLocalNameOfContainer,
|
||||
getExpressionNamePrefix: getExpressionNamePrefix,
|
||||
getExportAssignmentName: getExportAssignmentName,
|
||||
isReferencedImportDeclaration: isReferencedImportDeclaration,
|
||||
getNodeCheckFlags: getNodeCheckFlags,
|
||||
getEnumMemberValue: getEnumMemberValue,
|
||||
isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName,
|
||||
hasSemanticErrors: hasSemanticErrors,
|
||||
isEmitBlocked: isEmitBlocked,
|
||||
isDeclarationVisible: isDeclarationVisible,
|
||||
isImplementationOfOverload: isImplementationOfOverload,
|
||||
writeTypeAtLocation: writeTypeAtLocation,
|
||||
writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration,
|
||||
isSymbolAccessible: isSymbolAccessible,
|
||||
isImportDeclarationEntityNameReferenceDeclarationVisibile: isImportDeclarationEntityNameReferenceDeclarationVisibile,
|
||||
getConstantValue: getConstantValue,
|
||||
getLocalNameOfContainer,
|
||||
getExpressionNamePrefix,
|
||||
getExportAssignmentName,
|
||||
isReferencedImportDeclaration,
|
||||
getNodeCheckFlags,
|
||||
getEnumMemberValue,
|
||||
isTopLevelValueImportWithEntityName,
|
||||
hasSemanticErrors,
|
||||
isEmitBlocked,
|
||||
isDeclarationVisible,
|
||||
isImplementationOfOverload,
|
||||
writeTypeAtLocation,
|
||||
writeReturnTypeOfSignatureDeclaration,
|
||||
isSymbolAccessible,
|
||||
isImportDeclarationEntityNameReferenceDeclarationVisibile,
|
||||
getConstantValue,
|
||||
};
|
||||
checkProgram();
|
||||
return emitFiles(resolver, targetSourceFile);
|
||||
|
|
Loading…
Reference in a new issue