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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 16 11:05:05 PDT 2017


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

--- Comment #55 from Saam Barati <sbarati at apple.com> ---
(In reply to Caio Lima from comment #49)
> Created attachment 310219 [details]
> WIP - Patch RFC
> 
> The problem of last implementation is that it was considering that
> excludedList was always statically defined, but the example below shows that
> it's not true:
> 
> ```
> let a = "foo";
> let {[a]: b, ...r} = {foo: 2, bar 3};
> // b == 2;
> // r.bar == 3;
> ```
> 
> This way, I decided change my approach and emit bytecode to fill
> excludedList, and then now we can carry the case above properly.
> I added the test was in our suite but I would like to check EWS and get
> feedback as well here.
This sounds right to me when we have computed properties. However, I think it's a good optimization to build the list at compile time when we know all the properties statically. So I think we should have a combination of the old code and the new code depending on some simple static analysis.

> 
> The previous implementations was faster and I'm thinking in a way to allow
> static usage that probably will the common case for this feature, but I
> think it's worth it bring it in another Patch. 
> 
> Also, I think it's a good idea put this feature behind a flag before commit.
Yeah this sounds good. You could probably just put the feature check in the parser.

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


More information about the webkit-unassigned mailing list