<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:ggaren@apple.com" title="Geoffrey Garen <ggaren@apple.com>"> <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@apple.com" title="Geoffrey Garen <ggaren@apple.com>"> <span class="fn">Geoffrey Garen</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=265428&action=diff" name="attach_265428" title="Accept any LHS for AssignmentElements (no tests yet)">attachment 265428</a> <a href="attachment.cgi?id=265428&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&action=review">https://bugs.webkit.org/attachment.cgi?id=265428&action=review</a>
Thanks for the patch. This looks pretty good.
Please add test cases. Also, a few comments below.
<span class="quote">> Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:3454
> +void AssignmentElementNode::toString(StringBuilder& builder) const
> +{
> + if (m_assignmentTarget->isResolveNode())
> + builder.append(static_cast<ResolveNode*>(m_assignmentTarget)->identifier().string());
> +}</span >
Can you add support for isDotAccessorNode and isBracketAccessorNode here?
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:864
> + if (!element || !context.isAssignmentLocation(element)) {
> + // 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>
> + return 0;</span >
You can use "failIfFalse(element && context.isAssignmentLocation(element), message)" 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>