<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <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#c5">Comment # 5</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>(In reply to <a href="show_bug.cgi?id=146934#c4">comment #4</a>)
<span class="quote">&gt; Comment on <span class="bz_obsolete"><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>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <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>
&gt; 
&gt; &gt;&gt; Source/JavaScriptCore/parser/Parser.h:1080
&gt; &gt;&gt; +        
&gt; &gt; 
&gt; &gt; This code isn't correct.
&gt; &gt; It won't parse:
&gt; &gt; ```
&gt; &gt; (a, b, {c}, [d], {e, f}) =&gt; ...;
&gt; &gt; ```
&gt; &gt; 
&gt; &gt; I suggest an alternate approach here:
&gt; &gt; have this code check if we have the single parameter name with no parens case:
&gt; &gt; ```
&gt; &gt; let x = a=&gt;a;
&gt; &gt; ``` 
&gt; &gt; and otherwise, we already know how to parse &quot;(p1, p2, ...)&quot; style parameter lists
&gt; &gt; in another function in the parser. We should use that same code here. Either we use
&gt; &gt; it directly as is (probably not possible), or we should abstract that code in such a way
&gt; &gt; that this code can use it. That way, we don't have to places in the parser where we parse parameters.
&gt; &gt; 
&gt; &gt; The reason we have this problem in the first place is that we have two places where we parse
&gt; &gt; parameters, lets not make that mistake again.
&gt; 
&gt; I've tried to use function that parse parameters - parseFormalParameters,
&gt; however parseFormalParameters adds parsed parameters to current scope, so I
&gt; had to make face scope to avoid errors. 
&gt; Could you please check if it acceptable?</span >

I think this approach is okay. It's unfortunate we have to create
a scope here, but this is probably the most reliable way to future-proof
this code.</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>