Adding fix for crash and changing test names

This commit is contained in:
navya9singh 2023-02-07 00:06:04 +00:00
parent 376c3cdff8
commit e9a5b2aaeb
3 changed files with 8 additions and 4 deletions

View File

@ -3341,6 +3341,9 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
}
});
}
if (isPrototypeProperty && namespaceSymbol && namespaceSymbol.valueDeclaration) {
if (isAssignmentDeclaration(namespaceSymbol.valueDeclaration)) containerIsClass = false;
}
if (containerIsClass && namespaceSymbol && namespaceSymbol.valueDeclaration) {
addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, SymbolFlags.Class);
}

View File

@ -1,6 +1,7 @@
// @filename: a.js
// @noEmit: true
// @checkJs: true
// @filename: a.js
Thing.abc = 123
Thing.prototype.def = 456
new Thing();
new Thing();

View File

@ -1,11 +1,11 @@
/// <reference path="fourslash.ts" />
// @Filename: a.js
// @allowJs: true
// @Filename: a.js
//// Thing.abc = 123
//// Thing.prototype.def = 456
//// new Thing/**/();
verify.goToDefinition("", "");
verify.noErrors();
verify.noErrors();