Mark S. Miller (2014-01-08T16:32:07.000Z)
domenic at domenicdenicola.com (2014-01-14T17:43:08.474Z)
On Wed, Jan 8, 2014 at 2:33 AM, Andreas Rossberg <rossberg at google.com>wrote: > I don't think this flies anyway. It has to be more like a function > body, otherwise `var` and `function` declarations would hoist out of it, > which would be insane IMO. strict function declarations don't hoist out of blocks, so the hoisting issue is `var` only. I would find it surprising if `var` declarations did not hoist out of `do` expressions. > What I'm arguing for, then, simply is to make it as much like a > function body as possible. (That also matches the current IIFE > practice best.) > > Also, I really would want to avoid examples like > > ```js > return do { break; } > ``` > > and similar craze. > > Is there a convincing example where cross-expression jumps would > actually be useful? > 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. 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`.