TypeScript/tests/cases/conformance/classes/propertyMemberDeclarations
Nathan Shively-Sanders 369900bb07
Emit defineProperty calls before param prop assignments (#34987)
* Emit defineProperty calls before param prop assignments

Note that I restricted this to --useDefineForClassFields is true.
Nothing changes when it's off. I think this is the correct fix for a
patch release.

However, in principal there's nothing wrong with moving parameter
property initialisation after property declaration initialisation. It
would be Extremely Bad and Wrong to rely on this working:

```ts
class C {
  p = this.q // what is q?
  constructor(public q: number) { }
}
```

But today it does, and probably somebody relies on it without knowing.

* Put parameter property initialiser into defineProperty's value

* Combine ES5/ESNext into one test
2019-11-22 15:37:24 -08:00
..
memberAccessorDeclarations Allow accessors in ambient class declarations (#32787) 2019-08-09 16:11:25 -07:00
memberFunctionDeclarations
accessibilityModifiers.ts
accessorsOverrideMethod.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
accessorsOverrideProperty.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
accessorsOverrideProperty2.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
accessorsOverrideProperty3.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
accessorsOverrideProperty4.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
accessorsOverrideProperty5.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
accessorsOverrideProperty6.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
accessorsOverrideProperty7.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
constructorParameterShadowsOuterScopes.ts
defineProperty.ts Emit defineProperty calls before param prop assignments (#34987) 2019-11-22 15:37:24 -08:00
definePropertyOutputES3.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
derivedUninitializedPropertyDeclaration.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
initializerReferencingConstructorLocals.ts
initializerReferencingConstructorParameters.ts
instanceMemberInitialization.ts Move class property transform (#31848) 2019-06-17 14:26:42 -07:00
instanceMemberWithComputedPropertyName.ts Fix visitLexicalEnvironment to properly merge hoisted declarations (#33219) 2019-09-03 15:29:41 -07:00
instanceMemberWithComputedPropertyName2.ts Emit computed property temps even w/o init w/useDefineForClassFields (#34406) 2019-10-18 13:23:38 -07:00
optionalMethod.ts strip QuestionToken from MethodDeclaration and PropertyDeclaration emit (#34954) 2019-11-12 10:30:46 -08:00
optionalProperty.ts strip QuestionToken from MethodDeclaration and PropertyDeclaration emit (#34954) 2019-11-12 10:30:46 -08:00
overrideInterfaceProperty.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
propertyAndAccessorWithSameName.ts
propertyAndFunctionWithSameName.ts
propertyNamedConstructor.ts Emit error on class fields named "constructor" 2019-04-25 17:30:41 -07:00
propertyNamedPrototype.ts
propertyOverridesAccessors.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
propertyOverridesAccessors2.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
propertyOverridesAccessors3.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
propertyOverridesAccessors4.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
propertyOverridesAccessors5.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
propertyOverridesMethod.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
staticAndNonStaticPropertiesSameName.ts
staticMemberInitialization.ts
staticPropertyAndFunctionWithSameName.ts
staticPropertyNameConflicts.ts Removing es6 method/property distinction. 2017-01-14 16:30:12 +01:00
staticPropertyNameConflictsInAmbientContext.ts Add tests 2017-01-21 17:09:09 +01:00
strictPropertyInitialization.ts Add regression test 2019-02-05 13:08:18 -08:00
thisInInstanceMemberInitializer.ts
thisPropertyOverridesAccessors.ts Add useDefineForClassFields flag for Set -> Define property declaration (#33509) 2019-09-26 13:25:05 -07:00
twoAccessorsWithSameName.ts
twoAccessorsWithSameName2.ts