TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment27.ts
Nathan Shively-Sanders 50ef631b59
Support prototype assignment with a function declaration (#25300)
Previously variable declaration+function expression worked.
Note that class expression/class declaration do not work, due to the way
they are specified. I added a test for future reference.
2018-07-05 09:04:28 -07:00

12 lines
203 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: a.js
// mixed prototype-assignment+function declaration
function C() { this.p = 1; }
C.prototype = { q: 2 };
const c = new C()
c.p
c.q