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

Already on GitHub? Sign in to your account

Block unsafe use of arrow functions #5

Open
schmod opened this issue Jul 25, 2016 · 2 comments
Open

Block unsafe use of arrow functions #5

schmod opened this issue Jul 25, 2016 · 2 comments

Comments

@schmod
Copy link
Owner

schmod commented Jul 25, 2016

Arrow functions cannot be safely used in providers or services, because these types are intended to be invoked with the new operator, and expect to have their own value of this.

We should discourage (or outright disallow) people from doing this, because the breakages that it causes could lead to subtle and unpredictable bugs.

@schmod
Copy link
Owner Author

schmod commented Jul 25, 2016

Counterpoint: This could be beyond the scope of what this project is meant to provide.

@mgol
Copy link

mgol commented Jul 26, 2016

Yeah, I think such things are more in scope of a linter.

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

No branches or pull requests

2 participants