368db997ed
* ESNext+[[Define]]: reference to param props illegal When target: "esnext" and useDefineForClassFields: true, property declaration initialisers should not be able to reference parameter properties; class fields are initialised before the constructor runs, but parameter properties are not: ```ts class C { foo = this.bar constructor(public bar: string) { } } ``` emits code that looks like this: ```js class C { bar foo = this.bar constructor(bar) { this.bar = bar } } new C('x').foo.length // crashes; foo is undefined ``` This PR adds an error on foo's declaration with ESNext+[[Define]]. * improve test |
||
---|---|---|
.. | ||
classDeclarations | ||
classExpressions | ||
constructorDeclarations | ||
indexMemberDeclarations | ||
members | ||
methodDeclarations | ||
propertyMemberDeclarations | ||
awaitAndYieldInProperty.ts | ||
classExpression.ts | ||
mixinAccessModifiers.ts | ||
mixinClassesAnnotated.ts | ||
mixinClassesAnonymous.ts | ||
mixinClassesMembers.ts | ||
nestedClassDeclaration.ts |