File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16852,9 +16852,10 @@ namespace ts {
1685216852 // in a JS file
1685316853 // Note:JS inferred classes might come from a variable declaration instead of a function declaration.
1685416854 // In this case, using getResolvedSymbol directly is required to avoid losing the members from the declaration.
16855- const funcSymbol = node.expression.kind === SyntaxKind.Identifier ?
16856- getResolvedSymbol(node.expression as Identifier) :
16857- checkExpression(node.expression).symbol;
16855+ let funcSymbol = checkExpression(node.expression).symbol;
16856+ if (!funcSymbol && node.expression.kind === SyntaxKind.Identifier) {
16857+ funcSymbol = getResolvedSymbol(node.expression as Identifier);
16858+ }
1685816859 const type = funcSymbol && getJavaScriptClassType(funcSymbol);
1685916860 if (type) {
1686016861 return type;
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts" />
2+
3+ // @allowJs : true
4+ // @Filename : something.js
5+ //// function TestObj(){
6+ //// this.property = "value";
7+ //// }
8+ //// var constructor = TestObj;
9+ //// var instance = new constructor();
10+ //// instance./*a*/
11+ //// var class2 = function() { };
12+ //// class2.prototype.blah = function() { };
13+ //// var inst2 = new class2();
14+ //// inst2.blah/*b*/;
15+
16+ goTo . marker ( 'a' ) ;
17+ verify . completionListContains ( 'property' ) ;
18+ edit . backspace ( ) ;
19+
20+ goTo . marker ( 'b' ) ;
21+ verify . quickInfoIs ( '(property) class2.blah: () => void' ) ;
You can’t perform that action at this time.
0 commit comments