Skip to content

Allow referencing 'this' in parameters of functions in the constructor #29298

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Jan 7, 2019

Fixes: #29286

This also affects referencing super in parameters or unrelated functions.

A future PR could update this check to treat immediately invoked arrow functions as inlined (like #29160 does for 'parameter cannot reference identifiers declared after it')

@Jessidhia
Copy link

Interesting; you can probably only get away with this in TS's ES5 emit because you don't use .bind() 😅

(It is valid ES2015, of course, just hard to transpile to ES5-)

@ajafff
Copy link
Contributor Author

ajafff commented Jan 10, 2019

@kovensky can you give an example of what you think might fail when downlevelled to ES5?

Copy link
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge on Tuesday

@RyanCavanaugh RyanCavanaugh self-assigned this Jan 25, 2019
@RyanCavanaugh RyanCavanaugh merged commit aad609c into microsoft:master Jan 31, 2019
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.

4 participants