[Webkit-unassigned] [Bug 172031] [ESnext] Parsing Object Rest Destructuring isn't handle errors cases properly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 15 11:49:24 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=172031

--- Comment #4 from Caio Lima <ticaiolima at gmail.com> ---

> I'm not sure that this is true.
> 1. If kind != DestructuringKind::DestructureToExpressions,
> parseBindingOrAssignmentElement() returns the result of
> parseDestructuringPattern().
> 2. In parseDestructuringPattern(),
>     a. the OPENBRACKET case has a consumeOrFail that can return 0.
>     b. the OPENBRACE case has failIfTrue, failIfTrueIfStrict,
> semanticFailIfTrue, etc. that can return 0.
> 
> These are just a few examples.  How did you prove that all of these (and
> other similar failout macros) are not also returning if kind !=
> DestructuringKind::DestructureToExpressions

Oops, you are right about 2. I'm not considering the failout macros, my bad here. I was just considering the plain returns 0 in parseDestructuringPattern. But when they fail, it's going to cascade the syntax error to its client, right? So the check I've removed is still valid in that case, or Am I missing something? The problem I'm trying to solve is to return 0 if interPattern is 0, regardless the destructuring kind. Making it strictly to DestructuringToExpressions doesn't see right here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170515/6bf0716d/attachment.html>


More information about the webkit-unassigned mailing list