[webkit-reviews] review granted: [Bug 167963] [ESnext] Implement Object Spread : [Attachment 314099] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 30 18:06:17 PDT 2017


Yusuke Suzuki <utatane.tea at gmail.com> has granted Caio Lima
<ticaiolima at gmail.com>'s request for review:
Bug 167963: [ESnext] Implement Object Spread
https://bugs.webkit.org/show_bug.cgi?id=167963

Attachment 314099: Patch

https://bugs.webkit.org/attachment.cgi?id=314099&action=review




--- Comment #21 from Yusuke Suzuki <utatane.tea at gmail.com> ---
Comment on attachment 314099
  --> https://bugs.webkit.org/attachment.cgi?id=314099
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=314099&action=review

r=me with comments.

> Source/JavaScriptCore/ChangeLog:14
> +	   It's also fixing CopyDataProperties that was using
> +	   Object.getOwnPropertyNames to list all keys to be copied, and now is
> +	   using Relect.ownKeys.

Let's drop this.

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:1959
> +    for (const auto& entry : m_codeBlock->constantIdentifierSets()) {

OK, reference is better here.

> Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:4326
> +    return 0;

Should return dst.

> Source/JavaScriptCore/parser/Parser.cpp:3880
> -	   if (m_useObjectRestSpread) {
> -	       classifyExpressionError(ErrorIndicatesPattern);
> -	       return 0;
> -	   }
> -	   FALLTHROUGH;
> +	   auto spreadLocation = m_token.m_location;
> +	   auto start = m_token.m_startPosition;
> +	   auto divot = m_token.m_endPosition;
> +	   next();
> +	   TreeExpression elem =
parseAssignmentExpressionOrPropagateErrorClass(context);
> +	   failIfFalse(elem, "Cannot parse subject of a spread operation");
> +	   auto node = context.createObjectSpreadExpression(spreadLocation,
elem, start, divot, m_lastTokenEndPosition);
> +	   return context.createProperty(node, PropertyNode::Spread,
PropertyNode::Unknown, complete, SuperBinding::NotNeeded, isClassProperty);

I think we need to use `Options::useObjectRestSpread()` here to guard against
using it. Correct?


More information about the webkit-reviews mailing list