-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
tools: remove no-let-in-for-declaration lint rule #15648
Conversation
After the upgrade of V8 to a version powered by TurboFan, the recommendation not to use `var` for `for` loops is obsolete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but do you have a reference to something that describes that this became unnecessary?
@BridgeAR Well there's https://v8project.blogspot.com/2017/05/launching-ignition-and-turbofan.html... Not sure if there's anything more I could use. |
Btw slight typo in the description (and commit):
(the above has |
I fixed the typo in the description. The reference to the launch of ignition and turbofan is not a proper sign that let is not causing any trouble anymore though. See 55f9c85 as a example that even const had issues until now. @bmeurer can you give us any further insight if there are any potential deopts left or is let definitely on par with var? |
If I remember correctly this was before v8 6.0 but to be honest I don't know if everything has been resolved in v8 6.0. |
That was only one of two of those.
When reading the description of the mentioned commit it does not sound like that to me.
|
Oops, misread the description. We are at 6.1 now, but let's wait until @bmeurer can explain the performance implication a bit more clearly. |
for (let i = 0; i < 1000; ++i) {
array.forEach(o => o.i += i);
} This will be slow even with TurboFan. And it also has a different meaning than if you'd use So it might be a good idea to keep the rule in place, even if only to prevent the bugs. |
I think @bmeurer has made a good enough case against this, especially if escape analysis is to be disabled momentarily. Thus, closing for now. |
After the upgrade of V8 to a version powered by TurboFan, the
recommendation not to use
let
forfor
loops is obsolete.Checklist
Affected core subsystem(s)
tools