Changeset 246333 in webkit


Ignore:
Timestamp:
Jun 11, 2019 2:42:41 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Error message for non-callable Proxy construct trap is misleading
https://bugs.webkit.org/show_bug.cgi?id=198637

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

JSTests:

  • stress/proxy-construct.js:

Source/JavaScriptCore:

Just like other traps, Proxy construct trap is invoked with Call?, not Construct?.

  • runtime/ProxyObject.cpp:

(JSC::performProxyConstruct): Tweak error message.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r246332 r246333  
     12019-06-11  Alexey Shvayka  <shvaikalesh@gmail.com>
     2
     3        Error message for non-callable Proxy `construct` trap is misleading
     4        https://bugs.webkit.org/show_bug.cgi?id=198637
     5
     6        Reviewed by Saam Barati.
     7
     8        * stress/proxy-construct.js:
     9
    1102019-06-10  Tadeu Zagallo  <tzagallo@apple.com>
    211
  • trunk/JSTests/stress/proxy-construct.js

    r198813 r246333  
    1616        } catch(e) {
    1717            threw = true;
    18             assert(e.toString() === "TypeError: 'construct' property of a Proxy's handler should be constructible");
     18            assert(e.toString() === "TypeError: 'construct' property of a Proxy's handler should be callable");
    1919        }
    2020        assert(threw);
     
    3434        } catch(e) {
    3535            threw = true;
    36             assert(e.toString() === "TypeError: 'construct' property of a Proxy's handler should be constructible");
     36            assert(e.toString() === "TypeError: 'construct' property of a Proxy's handler should be callable");
    3737        }
    3838        assert(threw);
  • trunk/Source/JavaScriptCore/ChangeLog

    r246332 r246333  
     12019-06-11  Alexey Shvayka  <shvaikalesh@gmail.com>
     2
     3        Error message for non-callable Proxy `construct` trap is misleading
     4        https://bugs.webkit.org/show_bug.cgi?id=198637
     5
     6        Reviewed by Saam Barati.
     7
     8        Just like other traps, Proxy `construct` trap is invoked with [[Call]], not [[Construct]].
     9
     10        * runtime/ProxyObject.cpp:
     11        (JSC::performProxyConstruct): Tweak error message.
     12
    1132019-06-10  Tadeu Zagallo  <tzagallo@apple.com>
    214
  • trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp

    r245675 r246333  
    572572    CallData callData;
    573573    CallType callType;
    574     JSValue constructMethod = handler->getMethod(exec, callData, callType, makeIdentifier(vm, "construct"), "'construct' property of a Proxy's handler should be constructible"_s);
     574    JSValue constructMethod = handler->getMethod(exec, callData, callType, makeIdentifier(vm, "construct"), "'construct' property of a Proxy's handler should be callable"_s);
    575575    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    576576    JSObject* target = proxy->target();
Note: See TracChangeset for help on using the changeset viewer.