https://codereview.chromium.org/1309813007/diff/210001/src/preparser.h
File src/preparser.h (right):
https://codereview.chromium.org/1309813007/diff/210001/src/preparser.h#newcode2622
src/preparser.h:2622: classifier->RecordPatternError(
On 2015/10/29 16:38:41, caitp wrote:
On 2015/10/28 19:11:41, adamk wrote:
> Why is this not directly calling RecordAssignmentPatternError? Were
we getting
> this wrong before, or does this have to do with the ambiguity in
arrow params?
>
> Same question for the below calls to RecordPatternError.
It's an invalid binding pattern as well as invalid assignment pattern,
but
there's no information about which one we think we're parsing, and
even if we
think we're expecting an assignment, the `( expression ) [maybe =>]`
case makes
it ambiguous. So this one records the error for both.
Sorry, I didn't highlight the most important question: was this already
broken for binding patterns? What confuses me about these checks is that
I would have assumed that our destructuring binding tests would already
exercise these paths.
https://codereview.chromium.org/1309813007/diff/210001/src/preparser.h#newcode2638
src/preparser.h:2638: MessageTemplate::kElementAfterRest);
On 2015/10/29 16:38:41, caitp wrote:
On 2015/10/28 19:11:41, adamk wrote:
> This error is already handled for binding patterns down below, see
"if
> (seen_spread)". Is the idea that you're giving a better error
message here?
Yeah, I think the message is better than "unexpected token...". I
guess the
redundant code should be removed
There are plenty of existing places where we use
BindingPatternUnexpectedToken, it's not clear to me why this case should
be special.
https://codereview.chromium.org/1309813007/
--
--
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.