Bug 155099

Summary: [ES6] Implement Proxy.[[GetPrototypeOf]]
Product: WebKit Reporter: Saam Barati <saam>
Component: JavaScriptCoreAssignee: Saam Barati <saam>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, fpizlo, ggaren, gskachkov, keith_miller, mark.lam, msaboff, oliver, sukolsak, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch mark.lam: review+

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