Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃 Cherry-pick PR #34987 into release-3.7 #35303

Merged

Conversation

typescript-bot
Copy link
Collaborator

This cherry-pick was triggerd by a request on #34987
Please review the diff and merge if no changes are unexpected.
You can view the cherry-pick log here.

cc @sandersn

Component commits:
5810765 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.

ec79590 Put parameter property initialiser into defineProperty's value

be86355 Merge branch 'master' into fix-defineProperty-parameter-property-emit

8ff59b9 Combine ES5/ESNext into one test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants