-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @filename: a.js
OOOrder.prototype.m = function () {
this.p = 1
}
function OOOrder() {
this.x = 1
}
Expected behavior:
No crash, and OOOrder
has instance type { p: number | undefined, x: number }
Actual behavior:
Crash in the binder trying to add p
to OOOrder
: constructorSymbol.members = constructorSymbol.members || createSymbolTable();
when constructorSymbol
isn't defined.
Before #22643, this incorrectly added p
to the instance of m
, which is incorrect. So falling back to the old behaviour isn't a good option. Instead it needs the same created-nested-namespace logic as bindPropertyAssignment and bindExportsPropertyAssignment.
DanielRosenwasser
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue