Closed
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.