Bug 158350 - Proxy.ownKeys should no longer throw an exception when duplicate keys are returned and the target is non-extensible
Summary: Proxy.ownKeys should no longer throw an exception when duplicate keys are ret...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-03 11:13 PDT by Saam Barati
Modified: 2016-06-03 17:33 PDT (History)
12 users (show)

See Also:


Attachments
Patch (8.87 KB, patch)
2016-06-03 14:29 PDT, Saam Barati
msaboff: review+
Details | Formatted Diff | Diff
Patch for landing (9.88 KB, patch)
2016-06-03 15:17 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-06-03 11:13:02 PDT
See:
https://github.com/tc39/ecma262/pull/594
Comment 1 Radar WebKit Bug Importer 2016-06-03 11:16:28 PDT
<rdar://problem/26626211>
Comment 2 Saam Barati 2016-06-03 14:29:26 PDT
Created attachment 280467 [details]
Patch
Comment 3 Mark Lam 2016-06-03 14:40:54 PDT
Comment on attachment 280467 [details]
Patch

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

> Source/JavaScriptCore/runtime/ProxyObject.cpp:938
> +            bool isContainedIn = false;
> +            return isContainedIn;

Your definition of "isContainedIn" here differs from the one below.  Did you mean "isNotContainedIn" instead?
Comment 4 Michael Saboff 2016-06-03 14:41:03 PDT
Comment on attachment 280467 [details]
Patch

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

r=me

> Source/JavaScriptCore/runtime/ProxyObject.cpp:934
>      auto removeIfContainedInUncheckedResultKeys = [&] (UniquedStringImpl* impl) -> bool {

This lambda's name should probably change to something without "removeIf".

> Source/JavaScriptCore/runtime/ProxyObject.cpp:938
> +            bool isContainedIn = false;
> +            return isContainedIn;

Change this to "return false".

> Source/JavaScriptCore/runtime/ProxyObject.cpp:943
> +        bool isContainedIn = true;
>          return isContainedIn;

Change this to "return true".
Comment 5 Saam Barati 2016-06-03 15:13:58 PDT
Comment on attachment 280467 [details]
Patch

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

>> Source/JavaScriptCore/runtime/ProxyObject.cpp:934
>>      auto removeIfContainedInUncheckedResultKeys = [&] (UniquedStringImpl* impl) -> bool {
> 
> This lambda's name should probably change to something without "removeIf".

I think this would be more confusing. The function conditionally removes a key from the HashSet and the name of this lambda indicates that.

>>> Source/JavaScriptCore/runtime/ProxyObject.cpp:938
>>> +            return isContainedIn;
>> 
>> Your definition of "isContainedIn" here differs from the one below.  Did you mean "isNotContainedIn" instead?
> 
> Change this to "return false".

I'm going with an enum.
Comment 6 Saam Barati 2016-06-03 15:17:26 PDT
Created attachment 280471 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2016-06-03 17:33:06 PDT
Comment on attachment 280471 [details]
Patch for landing

Clearing flags on attachment: 280471

Committed r201672: <http://trac.webkit.org/changeset/201672>
Comment 8 WebKit Commit Bot 2016-06-03 17:33:10 PDT
All reviewed patches have been landed.  Closing bug.