Uh oh!
There was an error while loading. Please reload this page.
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.
TimothyGu
commented
Sep 28, 2017
@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 |
BridgeAR
commented
Sep 28, 2017
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. |
TimothyGu
commented
Sep 29, 2017
BridgeAR
commented
Sep 29, 2017
That was only one of two of those.
When reading the description of the mentioned commit it does not sound like that to me. |
TimothyGu
commented
Sep 29, 2017
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. |
bmeurer
commented
Sep 29, 2017
for(leti=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. |
TimothyGu
commented
Sep 30, 2017
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
letforforloops is obsolete.Checklist
Affected core subsystem(s)
tools