Bug 155099 - [ES6] Implement Proxy.[[GetPrototypeOf]]
Summary: [ES6] Implement Proxy.[[GetPrototypeOf]]
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:
Depends on:
Blocks:
 
Reported: 2016-03-06 16:04 PST by Saam Barati
Modified: 2016-03-07 15:28 PST (History)
11 users (show)

See Also:


Attachments
patch (17.41 KB, patch)
2016-03-07 13:53 PST, Saam Barati
mark.lam: review+
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-03-06 16:04:58 PST
...
Comment 1 Saam Barati 2016-03-07 13:53:31 PST
Created attachment 273207 [details]
patch
Comment 2 WebKit Commit Bot 2016-03-07 13:55:37 PST
Attachment 273207 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/ProxyObject.cpp:1051:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/JavaScriptCore/runtime/ProxyObject.cpp:1053:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Mark Lam 2016-03-07 14:11:03 PST
Comment on attachment 273207 [details]
patch

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

> Source/JavaScriptCore/runtime/ProxyObject.cpp:1035
> +    if (handlerValue.isNull()) {
> +        throwVMTypeError(exec, ASCIILiteral("Proxy 'handler' is null. It should be an Object."));
> +        return JSValue();
> +    }

The only way to get to performGetPrototype() is thru performProxyGet().  The only way to get to performProxyGet() is thru ProxyObject::getOwnPropertySlotCommon() returning a slot getter.  And ProxyObject::getOwnPropertySlotCommon() can only be called on a ProxyObject.  Hence, shouldn't this be an assert instead?
Comment 4 Mark Lam 2016-03-07 14:21:00 PST
Comment on attachment 273207 [details]
patch

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

>> Source/JavaScriptCore/runtime/ProxyObject.cpp:1035
>> +    }
> 
> The only way to get to performGetPrototype() is thru performProxyGet().  The only way to get to performProxyGet() is thru ProxyObject::getOwnPropertySlotCommon() returning a slot getter.  And ProxyObject::getOwnPropertySlotCommon() can only be called on a ProxyObject.  Hence, shouldn't this be an assert instead?

My mistake.  I didn't see the call from ProxyObject::getPrototype() below.
Comment 5 Saam Barati 2016-03-07 14:24:21 PST
I spoke with Mark in person.
For posterity:
calls to "proxy.__proto__" will route through performProxyGet.
Reflect/Object.getOwnPrototype will call straight through
to the method table implementation which calls through
to performProxyGet(.).
Comment 6 Mark Lam 2016-03-07 14:51:21 PST
Comment on attachment 273207 [details]
patch

r=me
Comment 7 Saam Barati 2016-03-07 15:28:31 PST
thanks for the review.
Landed in:
http://trac.webkit.org/changeset/197711