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
Arrow Methods incorrectly highlighted as bad code? #1457
Comments
It falls out of this proposal https://github.com/tc39/proposal-class-fields In particular this section https://github.com/tc39/proposal-class-fields#execution-of-initializer-expressions says points out they're basically field declarations and they're evaluated anytime the class is constructed/intialized They've been shipping since Chrome 72 https://developers.google.com/web/updates/2019/01/nic72#public-class-fields |
Note that private class fields also shipped https://developers.google.com/web/updates/2019/04/nic74#private-class-fields |
Note to self: Update JSHint if this ticket is closed: jshint/jshint#3139 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Arrow methods are apparently a shipping thing
A normal class
An arrow class method
this is apparently a shortcut for binding the method to the instance. In other words if I understand correctly it's a shortcut for this
It's already working in Chrome but JSFiddle is marking it as bad code
Note: It doesn't work in Firefox Nightly nor Safari Tech Preview so maybe I'm jumping the gun here.
The text was updated successfully, but these errors were encountered: