Bug 155560

Summary: [JSC] allow duplicate property names returned from Proxy ownKeys() trap
Product: WebKit Reporter: Caitlin Potter (:caitp) <caitp>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ggaren, keith_miller, mark.lam, msaboff, saam, sam, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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.