Comments addressed.
Initializers (+default parameters) have completely wrong scope so far. I'll
address everything relating to initializers in the follow-up


https://codereview.chromium.org/1189743003/diff/80001/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/1189743003/diff/80001/src/parser.cc#newcode3848
src/parser.cc:3848:
parser_->scope_->RemoveUnresolved(expr->AsVariableProxy());
On 2015/06/22 10:43:18, wingo wrote:
I see, for patterns this happens in
Parser::PatternRewriter::VisitVariableProxy.
  A comment would be appreciated tho :)

Done.

https://codereview.chromium.org/1189743003/diff/80001/test/cctest/test-parsing.cc
File test/cctest/test-parsing.cc (right):

https://codereview.chromium.org/1189743003/diff/80001/test/cctest/test-parsing.cc#newcode6608
test/cctest/test-parsing.cc:6608: TEST(DestructuringDuplicateParams) {
On 2015/06/22 10:28:33, wingo wrote:
Need tests that patterns are not allowed in rest parameters

function(...{}) {}
function(...{x}) {}
function(...[x]) {}
(...{}) => {}
(...{x}) => {}
(...[x]) => {}

Done (also fixed)

https://codereview.chromium.org/1189743003/diff/80001/test/cctest/test-parsing.cc#newcode6630
test/cctest/test-parsing.cc:6630: "function f(x, x, {a}) {}",
On 2015/06/22 10:28:33, wingo wrote:
Arrow function tests would be nice here:

   ({x, x}) => {}
   (x, {y, y}) => {}
   (x, {x, y}) => {}
   ({x}, ...x) => {}

   ([x, x]) => {}
   (x, [y, y]) => {}
   (x, [x, y]) => {}
   ([x], ...x) => {}

For arrow functions duplicate parameter detection does not work in
preparser (it is too expensive to use duplicate finder).
The test are in destructuring.js

https://codereview.chromium.org/1189743003/

--
--
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.

Reply via email to