Skip to content

Commit a5ddba4

Browse files
committed
cleanup
1 parent d78447b commit a5ddba4

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

‎tsc/internal/checker/checker.go‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ type EnumRelationKey struct {
112112
targetId ast.SymbolId
113113
}
114114

115+
type ResolvedModuleSourceKey struct {
116+
path tspath.Path
117+
sourceType *Type
118+
}
119+
115120
// TypeCacheKind
116121

117122
type CachedTypeKind int32
@@ -583,11 +588,6 @@ type Host interface {
583588

584589
var nextCheckerID atomic.Uint32
585590

586-
type resolvedModuleSourceKey struct {
587-
path tspath.Path
588-
sourceType *Type
589-
}
590-
591591
type Checker struct {
592592
id uint32
593593
program Program
@@ -660,7 +660,7 @@ type Checker struct {
660660
unresolvedSymbols map[string]*ast.Symbol
661661
errorTypes map[CacheHashKey]*Type
662662
moduleSymbols map[*ast.Node]*ast.Symbol
663-
resolvedModuleSourceSymbols map[resolvedModuleSourceKey]*ast.Symbol
663+
resolvedModuleSourceSymbols map[ResolvedModuleSourceKey]*ast.Symbol
664664
globalThisSymbol *ast.Symbol
665665
symbolTableAliasCache map[symbolTableID][]*ast.Symbol
666666
classExpressionNameTables map[ast.NodeId]ast.SymbolTable
@@ -14819,14 +14819,14 @@ func (c *Checker) getTargetOfImportClause(node *ast.Node) *ast.Symbol {
1481914819
func (c *Checker) getSourcePhaseImportTarget(moduleSpecifier *ast.Node, moduleSymbol *ast.Symbol, resolvedFileName string, sourceType *Type) *ast.Symbol {
1482014820
if moduleSymbol == nil {
1482114821
path := tspath.ToPath(resolvedFileName, c.program.GetCurrentDirectory(), c.program.UseCaseSensitiveFileNames())
14822-
key := resolvedModuleSourceKey{path: path, sourceType: sourceType}
14822+
key := ResolvedModuleSourceKey{path: path, sourceType: sourceType}
1482314823
sourceSymbol := c.resolvedModuleSourceSymbols[key]
1482414824
if sourceSymbol != nil {
1482514825
return sourceSymbol
1482614826
}
1482714827
sourceSymbol = c.createSourcePhaseImportTarget(nil /*moduleSymbol*/, sourceType)
1482814828
if c.resolvedModuleSourceSymbols == nil {
14829-
c.resolvedModuleSourceSymbols = make(map[resolvedModuleSourceKey]*ast.Symbol)
14829+
c.resolvedModuleSourceSymbols = make(map[ResolvedModuleSourceKey]*ast.Symbol)
1483014830
}
1483114831
c.resolvedModuleSourceSymbols[key] = sourceSymbol
1483214832
return sourceSymbol
@@ -15893,8 +15893,7 @@ func (c *Checker) resolveExternalModule(
1589315893
}
1589415894

1589515895
func (c *Checker) checkImportPathForRewrite(location *ast.Node, moduleReference string, errorNode *ast.Node, resolvedModule *module.ResolvedModule, sourceFile *ast.SourceFile) {
15896-
if c.compilerOptions.RewriteRelativeImportExtensions.IsTrue() &&
15897-
location.Flags&ast.NodeFlagsAmbient == 0 &&
15896+
if c.compilerOptions.RewriteRelativeImportExtensions.IsTrue() && location.Flags&ast.NodeFlagsAmbient == 0 &&
1589815897
!tspath.IsDeclarationFileName(moduleReference) &&
1589915898
!ast.IsLiteralImportTypeNode(location) &&
1590015899
!ast.IsPartOfTypeOnlyImportOrExportDeclaration(location) {

0 commit comments

Comments
 (0)