On 2015/08/20 21:24:48, Dan Ehrenberg wrote:
Such a weird spec, but your implementation makes sense. I can't think of a
simpler way. Why don't the default parameter direct evals just run within
the
function's existing var scope? (Or, why 1JS?!)
Because the var scope is not in scope for parameters. Otherwise, e.g. this
function f() { return 1 }
function g(x = f()) {
// ...way down
var f = 2
}
would have a rather surprising result (g() === undefined). I'd actually be
fine
if this happened with var (just don't use it), but for legacy reasons, inner
functions are var bindings, too, unless inside a block.
https://codereview.chromium.org/1292753007/
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.