[Webkit-unassigned] [Bug 167962] [ESnext] Implement Object Rest - Implementing Object Rest Destructuring

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 8 21:25:24 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=167962

--- Comment #38 from Caio Lima <ticaiolima at gmail.com> ---
Comment on attachment 303438
  --> https://bugs.webkit.org/attachment.cgi?id=303438
Patch

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

Thank you very much for the reviews

>> Source/JavaScriptCore/builtins/GlobalOperations.js:94
>> +    for (let nextKey of keys) {
> 
> I don't think this can be a for of loop since it uses the iterator protocol, which is, sadly, observable. Instead you should do an indexed loop. Getting the length property of keys should be fine since it's an array.
> 
> For some reason I thought I made this comment last time but I guess I forgot :(.

You are right. Thanks catching it. Changed.

>> Source/JavaScriptCore/bytecode/CodeBlock.cpp:2410
>> +    for (size_t i = 0; i < count; i++) {
> 
> I think you could do:
> for (const auto& entry : constants)
> 
> Your current code will use the copy constructor of HashSet, which we can avoid.

Agreed and changed.

>> Source/JavaScriptCore/bytecode/CodeBlock.cpp:2418
>> +        HashSet<UniquedStringImpl*> set = entry.first;
> 
> you can make this:
>  const HashSet<UniquedStringImpl*>& set = entry.first; 
> 
> for the same reason as above.

Ditto.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170309/af56bf23/attachment.html>


More information about the webkit-unassigned mailing list