<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function syntax. Arrow function should support the destructuring parameters."
   href="https://bugs.webkit.org/show_bug.cgi?id=146934">bug 146934</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #268657 Flags</td>
           <td>review?, commit-queue?
           </td>
           <td>review-, commit-queue-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function syntax. Arrow function should support the destructuring parameters."
   href="https://bugs.webkit.org/show_bug.cgi?id=146934#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6] Arrow function syntax. Arrow function should support the destructuring parameters."
   href="https://bugs.webkit.org/show_bug.cgi?id=146934">bug 146934</a>
              from <span class="vcard"><a class="email" href="mailto:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=268657&amp;action=diff" name="attach_268657" title="Patch">attachment 268657</a> <a href="attachment.cgi?id=268657&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=268657&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=268657&amp;action=review</a>

<span class="quote">&gt; Source/JavaScriptCore/parser/Parser.h:1080
&gt; +        else if (match(OPENPAREN)) {
&gt; +            // Let's check if this destructuring paramters
&gt; +            SavePoint saveArrowFunctionPoint = createSavePoint();
&gt; +            next(); // Consume OPENPAREN;
&gt; +            auto pattern = tryParseDestructuringPatternExpression(context, AssignmentContext::DeclarationStatement);
&gt; +            isArrowFunction = pattern &amp;&amp; consume(CLOSEPAREN) &amp;&amp; match(ARROWFUNCTION);
&gt; +            
&gt; +            restoreSavePoint(saveArrowFunctionPoint);
&gt; +        }
&gt; +        </span >

This code isn't correct.
It won't parse:
```
(a, b, {c}, [d], {e, f}) =&gt; ...;
```

I suggest an alternate approach here:
have this code check if we have the single parameter name with no parens case:
```
let x = a=&gt;a;
``` 
and otherwise, we already know how to parse &quot;(p1, p2, ...)&quot; style parameter lists
in another function in the parser. We should use that same code here. Either we use
it directly as is (probably not possible), or we should abstract that code in such a way
that this code can use it. That way, we don't have to places in the parser where we parse parameters.

The reason we have this problem in the first place is that we have two places where we parse
parameters, lets not make that mistake again.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>