News for hackers. Stuff that matters.
Re:Prepack helps make JavaScript code more efficient by yairhaimo on Tuesday May 16, 2017 @07:23AM (#14348747)
As long as the ahead of time optimizations that dont have a large enough negative drawback in another criteria (speed vs size) are welcomed by me, even if the JIT can do the same optimizations too. Regarding your code example, maybe prepack was changed in the past week and a half, but it is folded quite fine when i tried it:

  (function() {
    function foo() { const bar = 42; for (let i = 0; i <= bar; i++) { if (i  === bar) { return bar; } } };
    console.log(foo());
  })();

There are no comments on this comment yet.