Michael Ficarra
Michael Ficarra
The names of NFEs are in an intermediate scope, not the scope of their bodies. top-level -> foo body/params -> special scope for just the baz name -> baz body/params
@getify It is important to understand this distinction when analysing your second example (copied/simplified below) ```js var a = function baz() { var baz; return baz; }; a(); ``` If...
@getify Telling a partial story about the scope might be confusing, as users might be surprised that changing variable names makes scopes appear/disappear.
The error is here: https://github.com/int3/metajs/blob/a13f69c4679a3b0ee9206698fdd32de1f5304154/lib/interpreter.coffee#L110 The `Function.prototype.apply` implementation assumes a non-null second argument.
@int3: I recommend both [Constellation/estraverse](https://github.com/Constellation/estraverse) and [Constellation/escope](https://github.com/Constellation/escope). My favourite program doesn't work: ``` js (function(){ try { throw 0; } catch(a) { var a = 1; } console.log(a); }()); ```
@int3: you may be interested in this CoffeeScript proposal: https://github.com/jashkenas/coffee-script/issues/2762
Instinctually, they imply a `then undefined` to me, which is why I would prefer the alternative solution I mentioned. It's also more consistent with `(if condition then)`, which _does_ imply...
That's great. That's two special cases I can remove from my compiler.
related: #1358
We could just disable autocompletion in multiline mode.