Bug 155560 - [JSC] allow duplicate property names returned from Proxy ownKeys() trap
Summary: [JSC] allow duplicate property names returned from Proxy ownKeys() trap
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-16 14:53 PDT by Caitlin Potter (:caitp)
Modified: 2016-03-22 10:01 PDT (History)
8 users (show)

See Also:


Attachments
Patch (3.33 KB, patch)
2016-03-16 14:56 PDT, Caitlin Potter (:caitp)
no flags Details | Formatted Diff | Diff
Patch (5.54 KB, patch)
2016-03-22 07:17 PDT, Caitlin Potter (:caitp)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Caitlin Potter (:caitp) 2016-03-16 14:53:22 PDT
[JSC] allow duplicate property names returned from Proxy ownKeys() trap
Comment 1 Caitlin Potter (:caitp) 2016-03-16 14:56:26 PDT
Created attachment 274222 [details]
Patch
Comment 2 Saam Barati 2016-03-17 02:20:18 PDT
Comment on attachment 274222 [details]
Patch

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

> Source/JavaScriptCore/runtime/ProxyObject.cpp:879
> +        trapResult.addKnownUnique(ident.impl());

LGTM, but I think it's worth renaming "addKnownUnique"
That functions name has lost its meaning over time. Either in
this patch or another patch.
Comment 3 Darin Adler 2016-03-17 09:08:47 PDT
Comment on attachment 274222 [details]
Patch

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

>> Source/JavaScriptCore/runtime/ProxyObject.cpp:879
>> +        trapResult.addKnownUnique(ident.impl());
> 
> LGTM, but I think it's worth renaming "addKnownUnique"
> That functions name has lost its meaning over time. Either in
> this patch or another patch.

I completely agree. I came here just to write this comment!
Comment 4 Caitlin Potter (:caitp) 2016-03-21 04:15:37 PDT
I haven't been able to come up with a good alternative name, since "addKnownUnique" looks like it makes a lot of sense in the other place it's used
Comment 5 Saam Barati 2016-03-21 09:58:45 PDT
(In reply to comment #4)
> I haven't been able to come up with a good alternative name, since
> "addKnownUnique" looks like it makes a lot of sense in the other place it's
> used

I'll look at the other call sites later today, but just off the top
of my head, what about "append" or "addUnconditionally"?
Comment 6 Caitlin Potter (:caitp) 2016-03-22 07:17:34 PDT
Created attachment 274650 [details]
Patch
Comment 7 Caitlin Potter (:caitp) 2016-03-22 07:18:13 PDT
I've gone with "addUnchecked()", let me know if that works for you guys
Comment 8 Darin Adler 2016-03-22 09:14:42 PDT
Comment on attachment 274650 [details]
Patch

I think the name addUnchecked is OK for now. We should return later and consider renaming the other "add" functions to make it clearer that they enforce uniqueness. Since uniqueness is no longer an invariant of the class, the add function needs to make it clear that it’s a rule it implements.
Comment 9 WebKit Commit Bot 2016-03-22 10:01:07 PDT
Comment on attachment 274650 [details]
Patch

Clearing flags on attachment: 274650

Committed r198531: <http://trac.webkit.org/changeset/198531>
Comment 10 WebKit Commit Bot 2016-03-22 10:01:11 PDT
All reviewed patches have been landed.  Closing bug.