<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:ggaren&#64;apple.com" title="Geoffrey Garen &lt;ggaren&#64;apple.com&gt;"> <span class="fn">Geoffrey Garen</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Destructuring Assignment: Properties are valid AssignmentElements"
   href="https://bugs.webkit.org/show_bug.cgi?id=151026">bug 151026</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 #265428 Flags</td>
           <td>review?
           </td>
           <td>review-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Destructuring Assignment: Properties are valid AssignmentElements"
   href="https://bugs.webkit.org/show_bug.cgi?id=151026#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Destructuring Assignment: Properties are valid AssignmentElements"
   href="https://bugs.webkit.org/show_bug.cgi?id=151026">bug 151026</a>
              from <span class="vcard"><a class="email" href="mailto:ggaren&#64;apple.com" title="Geoffrey Garen &lt;ggaren&#64;apple.com&gt;"> <span class="fn">Geoffrey Garen</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=265428&amp;action=diff" name="attach_265428" title="Accept any LHS for AssignmentElements (no tests yet)">attachment 265428</a> <a href="attachment.cgi?id=265428&amp;action=edit" title="Accept any LHS for AssignmentElements (no tests yet)">[details]</a></span>
Accept any LHS for AssignmentElements (no tests yet)

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

Thanks for the patch. This looks pretty good.

Please add test cases. Also, a few comments below.

<span class="quote">&gt; Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:3454
&gt; +void AssignmentElementNode::toString(StringBuilder&amp; builder) const
&gt; +{
&gt; +    if (m_assignmentTarget-&gt;isResolveNode())
&gt; +        builder.append(static_cast&lt;ResolveNode*&gt;(m_assignmentTarget)-&gt;identifier().string());
&gt; +}</span >

Can you add support for isDotAccessorNode and isBracketAccessorNode here?

<span class="quote">&gt; Source/JavaScriptCore/parser/Parser.cpp:864
&gt; +                            if (!element || !context.isAssignmentLocation(element)) {
&gt; +                                // TODO: Early SyntaxError per <a href="http://tc39.github.io/ecma262/#sec-assignment-operators-static-semantics-early-errors">http://tc39.github.io/ecma262/#sec-assignment-operators-static-semantics-early-errors</a>
&gt; +                                return 0;</span >

You can use &quot;failIfFalse(element &amp;&amp; context.isAssignmentLocation(element), message)&quot; here.</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>