https://codereview.chromium.org/1127063003/diff/1/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/1127063003/diff/1/src/parser.cc#newcode3561
src/parser.cc:3561: Runtime::FunctionForId(Runtime::kInlineArguments);
On 2015/05/06 20:32:38, arv wrote:
I think Andreas wanted:

function f(x = expr) {}

to be desugared to:

function f(temp) {
   let x = IS_UNDEFINED(temp) ? expr : temp;
}

If you use %_Arguments(i), do you also need to check the number of
arguments so
you do not index out of bounds?

I don't think bounds-checking is needed --- at least in testing,
`(function(x = 1, y = 2) { return x + y; })();` works just fine. Maybe
that becomes an issue with the adapter frame issue

https://codereview.chromium.org/1127063003/diff/1/src/preparser.h
File src/preparser.h (right):

https://codereview.chromium.org/1127063003/diff/1/src/preparser.h#newcode3535
src/preparser.h:3535: Scope* param_scope = NewScope(scope_,
BLOCK_SCOPE);
On 2015/05/06 20:32:38, arv wrote:
Is BLOCK_SCOPE sufficient? Does it need this new
VAR_DECLARATION_SCOPE?


To get scoping right, we do need a new declaration scope --- but I think
we decided that would be the next step in a followup CL more focused on
scoping

function f(x = eval('var z = 2'), y = z) {
   return y;
}
f() === 2 // ?

is that eval a strict eval? So confusing...

Currently,

```
d8> function f(a = eval("var z = 2"), b = z) { return z; }
undefined
d8> f()
2
d8> z
(d8):1: ReferenceError: z is not defined
z
^
ReferenceError: z is not defined
    at (d8):1:1
```

You end up with that... I'm not sure if that's what we want, it probably
isn't. But it makes sense that `z` doesn't end up in the global scope

https://codereview.chromium.org/1127063003/diff/1/src/scopes.cc
File src/scopes.cc (right):

https://codereview.chromium.org/1127063003/diff/1/src/scopes.cc#newcode513
src/scopes.cc:513: void Scope::ShadowParametersForExpressions() {
On 2015/05/06 20:32:38, arv wrote:
This could use a comment

I believe there's a comment in parser.h for the function that calls it,
but yeah will do

https://codereview.chromium.org/1127063003/diff/1/src/scopes.h
File src/scopes.h (right):

https://codereview.chromium.org/1127063003/diff/1/src/scopes.h#newcode129
src/scopes.h:129: int pos, bool is_rest, bool* is_duplicate);
On 2015/05/06 20:32:38, arv wrote:
keep pos at end for consistency

Acknowledged.

https://codereview.chromium.org/1127063003/diff/1/test/mjsunit/harmony/optional-arguments.js
File test/mjsunit/harmony/optional-arguments.js (right):

https://codereview.chromium.org/1127063003/diff/1/test/mjsunit/harmony/optional-arguments.js#newcode17
test/mjsunit/harmony/optional-arguments.js:17: // TODO(caitp): infer
function name correctly
On 2015/05/06 20:32:38, arv wrote:
https://code.google.com/p/v8/issues/detail?id=3699

Acknowledged.

https://codereview.chromium.org/1127063003/

--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to