@@ -25,6 +25,32 @@ module ts {
25
25
26
26
var emptyArray : any [ ] = [ ] ;
27
27
var emptySymbols : SymbolTable = { } ;
28
+
29
+ var checker : TypeChecker = {
30
+ getProgram : ( ) => program ,
31
+ getDiagnostics : getDiagnostics ,
32
+ getGlobalDiagnostics : getGlobalDiagnostics ,
33
+ getNodeCount : ( ) => sum ( program . getSourceFiles ( ) , "nodeCount" ) ,
34
+ getIdentifierCount : ( ) => sum ( program . getSourceFiles ( ) , "identifierCount" ) ,
35
+ getSymbolCount : ( ) => sum ( program . getSourceFiles ( ) , "symbolCount" ) ,
36
+ getTypeCount : ( ) => typeCount ,
37
+ checkProgram : checkProgram ,
38
+ emitFiles : invokeEmitter ,
39
+ getParentOfSymbol : getParentOfSymbol ,
40
+ getTypeOfSymbol : getTypeOfSymbol ,
41
+ getPropertiesOfType : getPropertiesOfType ,
42
+ getPropertyOfType : getPropertyOfType ,
43
+ getSignaturesOfType : getSignaturesOfType ,
44
+ getIndexTypeOfType : getIndexTypeOfType ,
45
+ getReturnTypeOfSignature : getReturnTypeOfSignature ,
46
+ getSymbolsInScope : getSymbolsInScope ,
47
+ getSymbolInfo : getSymbolInfo ,
48
+ getTypeOfNode : getTypeOfNode ,
49
+ getApparentType : getApparentType ,
50
+ typeToString : typeToString ,
51
+ symbolToString : symbolToString ,
52
+ getAugmentedPropertiesOfApparentType : getAugmentedPropertiesOfApparentType
53
+ } ;
28
54
29
55
var undefinedSymbol = createSymbol ( SymbolFlags . Property | SymbolFlags . Transient , "undefined" ) ;
30
56
var argumentsSymbol = createSymbol ( SymbolFlags . Property | SymbolFlags . Transient , "arguments" ) ;
@@ -71,32 +97,6 @@ module ts {
71
97
var diagnostics : Diagnostic [ ] = [ ] ;
72
98
var diagnosticsModified : boolean = false ;
73
99
74
- var checker : TypeChecker = {
75
- getProgram : ( ) => program ,
76
- getDiagnostics : getDiagnostics ,
77
- getGlobalDiagnostics : getGlobalDiagnostics ,
78
- getNodeCount : ( ) => sum ( program . getSourceFiles ( ) , "nodeCount" ) ,
79
- getIdentifierCount : ( ) => sum ( program . getSourceFiles ( ) , "identifierCount" ) ,
80
- getSymbolCount : ( ) => sum ( program . getSourceFiles ( ) , "symbolCount" ) ,
81
- getTypeCount : ( ) => typeCount ,
82
- checkProgram : checkProgram ,
83
- emitFiles : invokeEmitter ,
84
- getParentOfSymbol : getParentOfSymbol ,
85
- getTypeOfSymbol : getTypeOfSymbol ,
86
- getPropertiesOfType : getPropertiesOfType ,
87
- getPropertyOfType : getPropertyOfType ,
88
- getSignaturesOfType : getSignaturesOfType ,
89
- getIndexTypeOfType : getIndexTypeOfType ,
90
- getReturnTypeOfSignature : getReturnTypeOfSignature ,
91
- getSymbolsInScope : getSymbolsInScope ,
92
- getSymbolInfo : getSymbolInfo ,
93
- getTypeOfNode : getTypeOfNode ,
94
- getApparentType : getApparentType ,
95
- typeToString : typeToString ,
96
- symbolToString : symbolToString ,
97
- getAugmentedPropertiesOfApparentType : getAugmentedPropertiesOfApparentType
98
- } ;
99
-
100
100
function addDiagnostic ( diagnostic : Diagnostic ) {
101
101
diagnostics . push ( diagnostic ) ;
102
102
diagnosticsModified = true ;
@@ -778,7 +778,7 @@ module ts {
778
778
// But it cant, hence the accessible is going to be undefined, but that doesnt mean m.c is accessible
779
779
// It is accessible if the parent m is accessible because then m.c can be accessed through qualification
780
780
meaningToLook = getQualifiedLeftMeaning ( meaning ) ;
781
- symbol = symbol . parent ;
781
+ symbol = getParentOfSymbol ( symbol ) ;
782
782
}
783
783
784
784
// This could be a symbol that is not exported in the external module
@@ -901,7 +901,7 @@ module ts {
901
901
if ( accessibleSymbolChain && ! needsQualification ( accessibleSymbolChain [ 0 ] , enclosingDeclaration , accessibleSymbolChain . length === 1 ? meaning : getQualifiedLeftMeaning ( meaning ) ) ) {
902
902
break ;
903
903
}
904
- symbol = accessibleSymbolChain ? accessibleSymbolChain [ 0 ] . parent : symbol . parent ;
904
+ symbol = getParentOfSymbol ( accessibleSymbolChain ? accessibleSymbolChain [ 0 ] : symbol ) ;
905
905
meaning = getQualifiedLeftMeaning ( meaning ) ;
906
906
}
907
907
0 commit comments