Andreas Rossberg (2014-01-09T14:18:25.000Z)
domenic at domenicdenicola.com (2014-01-14T17:47:27.759Z)
On 8 January 2014 17:32, Mark S. Miller <erights at google.com> wrote: > strict function declarations don't hoist out of blocks, so the hoisting > issue is `var` only. Good point. > I would find it surprising if `var` declarations did not > hoist out of do expressions. Interesting. I have the exact opposite expectation. And I don't see what good it would do usability-wise. > If all we want is sugar for IIFEs, I wouldn't bother. With arrow functions, > IIFEs are already a lot shorter. The extra brevity of `do` expressions is not > worth it. It's not only the brevity as such, but having a natural, targeted language feature. IIFEs are merely an encoding, and as such a distraction. Like A + -B is brief enough, but I'm sure you prefer saying A - B. > What would make do expressions worthy of consideration is if they repaired > the TCP violations of strict arrow IIFEs, including `var`, `arguments`, `break`, > `continue`, `return`, and especially `yield`. Can you clarify what you mean by "repair"? I hope you don't suggest that `while (true) { (() => do { break })() }` should magically work. I may warm up to the extra complexity more easily if somebody could present at least some compelling use cases. :)