50ef631b59
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.
15 lines
453 B
TypeScript
15 lines
453 B
TypeScript
// @noEmit: true
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
// @Filename: a.js
|
|
// mixed prototype-assignment+class declaration
|
|
class C { constructor() { this.p = 1; } }
|
|
// Property assignment does nothing.
|
|
// You have to use Object.defineProperty(C, "prototype", { q: 2 })
|
|
// and that only works on classes with no superclass.
|
|
// (Object.defineProperty isn't recognised as a JS special assignment right now.)
|
|
C.prototype = { q: 2 };
|
|
|
|
const c = new C()
|
|
c.p
|
|
c.q
|