Changeset 252019 in webkit


Ignore:
Timestamp:
Nov 4, 2019 3:29:10 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Set? isn't correct with respect to the spec and Proxy
https://bugs.webkit.org/show_bug.cgi?id=155012

Patch by Alexey Shvayka <Alexey Shvayka> on 2019-11-04
Reviewed by Saam Barati.

This patch merely removes a FIXME comment, as JavaScriptCore has already correct
implementation of ordinary Set?. In step 2.b of https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor,
if parent is a Proxy, the algorithm returns result of Proxy's Set? method call.
It is up to the author of "set" trap (if any) to consult the prototype chain.

All browsers pass https://test262.report/browse/built-ins/Proxy/set/call-parameters-prototype.js,
which asserts that no traps besides "set" are invoked on Proxies in prototype chain during Set?.

  • runtime/JSObject.cpp:

(JSC::JSObject::putInlineSlow):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r252015 r252019  
     12019-11-04  Alexey Shvayka  <shvaikalesh@gmail.com>
     2
     3        [[Set]] isn't correct with respect to the spec and Proxy
     4        https://bugs.webkit.org/show_bug.cgi?id=155012
     5
     6        Reviewed by Saam Barati.
     7
     8        This patch merely removes a FIXME comment, as JavaScriptCore has already correct
     9        implementation of ordinary [[Set]]. In step 2.b of https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor,
     10        if `parent` is a Proxy, the algorithm returns result of Proxy's [[Set]] method call.
     11        It is up to the author of "set" trap (if any) to consult the prototype chain.
     12
     13        All browsers pass https://test262.report/browse/built-ins/Proxy/set/call-parameters-prototype.js,
     14        which asserts that no traps besides "set" are invoked on Proxies in prototype chain during [[Set]].
     15
     16        * runtime/JSObject.cpp:
     17        (JSC::JSObject::putInlineSlow):
     18
    1192019-11-04  Robin Morisset  <rmorisset@apple.com>
    220
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r251967 r252019  
    839839        }
    840840        if (obj->type() == ProxyObjectType) {
    841             // FIXME: We shouldn't unconditionally perform [[Set]] here.
    842             // We need to do more because this is observable behavior.
    843             // https://bugs.webkit.org/show_bug.cgi?id=155012
    844841            ProxyObject* proxy = jsCast<ProxyObject*>(obj);
    845842            RELEASE_AND_RETURN(scope, proxy->ProxyObject::put(proxy, globalObject, propertyName, value, slot));
Note: See TracChangeset for help on using the changeset viewer.