Summary: | [JSC] allow duplicate property names returned from Proxy ownKeys() trap | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Caitlin Potter (:caitp) <caitp> | ||||||
Component: | JavaScriptCore | Assignee: | 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
Caitlin Potter (:caitp)
2016-03-16 14:53:22 PDT
Created attachment 274222 [details]
Patch
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 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! 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 (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"? Created attachment 274650 [details]
Patch
I've gone with "addUnchecked()", let me know if that works for you guys 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 on attachment 274650 [details] Patch Clearing flags on attachment: 274650 Committed r198531: <http://trac.webkit.org/changeset/198531> All reviewed patches have been landed. Closing bug. |