File tree Expand file tree Collapse file tree 2 files changed +50
-10
lines changed Expand file tree Collapse file tree 2 files changed +50
-10
lines changed Original file line number Diff line number Diff line change @@ -1929,6 +1929,8 @@ namespace ts.FindAllReferences {
1929
1929
case SyntaxKind . MethodDeclaration :
1930
1930
case SyntaxKind . MethodSignature :
1931
1931
if ( isObjectLiteralMethod ( searchSpaceNode ) ) {
1932
+ staticFlag &= getSyntacticModifierFlags ( searchSpaceNode ) ;
1933
+ searchSpaceNode = searchSpaceNode . parent ; // re-assign to be the owning object literals
1932
1934
break ;
1933
1935
}
1934
1936
// falls through
@@ -1970,7 +1972,8 @@ namespace ts.FindAllReferences {
1970
1972
return isObjectLiteralMethod ( searchSpaceNode ) && searchSpaceNode . symbol === container . symbol ;
1971
1973
case SyntaxKind . ClassExpression :
1972
1974
case SyntaxKind . ClassDeclaration :
1973
- // Make sure the container belongs to the same class
1975
+ case SyntaxKind . ObjectLiteralExpression :
1976
+ // Make sure the container belongs to the same class/object literals
1974
1977
// and has the appropriate static modifier from the original container.
1975
1978
return container . parent && searchSpaceNode . symbol === container . parent . symbol && ( getSyntacticModifierFlags ( container ) & ModifierFlags . Static ) === staticFlag ;
1976
1979
case SyntaxKind . SourceFile :
Original file line number Diff line number Diff line change 90
90
//// }
91
91
////
92
92
//// public static staticB = this.staticMethod1;
93
- ////
93
+ ////
94
94
//// public static staticMethod1() {
95
95
//// this;
96
96
//// this;
133
133
//// }
134
134
////
135
135
////var x = {
136
+ //// a: /*4*/this,
137
+ ////
136
138
//// f() {
137
- //// this/*4*/;
139
+ //// this/*5*/;
140
+ //// function foo() {
141
+ //// this;
142
+ //// }
143
+ //// const bar = () => {
144
+ //// this;
145
+ //// }
138
146
//// },
147
+ ////
139
148
//// g() {
140
- //// this/*5*/;
141
- //// }
142
- //// }
149
+ //// this;
150
+ //// },
151
+ ////
152
+ //// get h() {
153
+ //// /*7*/this;
154
+ //// function foo() {
155
+ //// this;
156
+ //// }
157
+ //// const bar = () => {
158
+ //// this;
159
+ //// }
160
+ //// return;
161
+ //// },
162
+ ////
163
+ //// set h(foo: any) {
164
+ //// this;
165
+ //// },
166
+ ////
167
+ //// l: () => {
168
+ //// /*8*/this;
169
+ //// function foo() {
170
+ //// this;
171
+ //// }
172
+ //// const bar = () => {
173
+ //// this;
174
+ //// }
175
+ //// },
176
+ //// };
177
+ ////
143
178
144
179
145
180
function verifyOccurrencesAtMarker ( marker : string , count : number ) {
146
181
goTo . marker ( marker ) ;
147
182
verify . occurrencesAtPositionCount ( count ) ;
148
183
}
149
184
150
- verifyOccurrencesAtMarker ( "1" , 2 ) ;
185
+ verifyOccurrencesAtMarker ( "1" , 5 ) ;
151
186
verifyOccurrencesAtMarker ( "2" , 6 ) ;
152
187
verifyOccurrencesAtMarker ( "3" , 1 ) ;
153
- verifyOccurrencesAtMarker ( "4" , 1 ) ;
154
- verifyOccurrencesAtMarker ( "5" , 1 ) ;
155
- verifyOccurrencesAtMarker ( "6" , 0 ) ;
188
+ verifyOccurrencesAtMarker ( "4" , 5 ) ;
189
+ verifyOccurrencesAtMarker ( "5" , 6 ) ;
190
+ verifyOccurrencesAtMarker ( "6" , 0 ) ;
191
+ verifyOccurrencesAtMarker ( "7" , 6 ) ;
192
+ verifyOccurrencesAtMarker ( "8" , 5 ) ;
You can’t perform that action at this time.
0 commit comments