Ignore:
Timestamp:
Feb 19, 2016, 2:56:31 PM (10 years ago)
Author:
[email protected]
Message:

[ES6] Implement Proxy.Call
https://bugs.webkit.org/show_bug.cgi?id=154425

Reviewed by Mark Lam.

This patch is a straight forward implementation of
Proxy.Call with respect to section 9.5.12
of the ECMAScript spec.
https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist

  • runtime/ProxyObject.cpp:

(JSC::ProxyObject::finishCreation):
(JSC::performProxyGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::performHasProperty):
(JSC::ProxyObject::getOwnPropertySlotByIndex):
(JSC::performProxyCall):
(JSC::ProxyObject::getCallData):
(JSC::ProxyObject::visitChildren):

  • runtime/ProxyObject.h:

(JSC::ProxyObject::create):

  • tests/es6.yaml:
  • tests/stress/proxy-call.js: Added.

(assert):
(throw.new.Error.let.target):
(throw.new.Error.let.handler.apply):
(throw.new.Error):
(assert.let.target):
(assert.let.handler.get apply):
(let.target):
(let.handler.apply):
(i.catch):
(assert.let.handler.apply):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/ProxyObject.h

    r196789 r196836  
    3636    typedef JSNonFinalObject Base;
    3737
    38     const static unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot;
     38    const static unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | TypeOfShouldCallGetCallData;
    3939
    4040    static ProxyObject* create(ExecState* exec, Structure* structure, JSValue target, JSValue handler)
     
    6262    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    6363    static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
     64    static CallType getCallData(JSCell*, CallData&);
    6465    static void visitChildren(JSCell*, SlotVisitor&);
    6566
     
    7071    WriteBarrier<JSObject> m_target;
    7172    WriteBarrier<Unknown> m_handler;
     73    bool m_isCallable : 1;
    7274};
    7375
Note: See TracChangeset for help on using the changeset viewer.