Ignore:
Timestamp:
Feb 18, 2016, 12:29:35 PM (10 years ago)
Author:
[email protected]
Message:

Implement Proxy.GetOwnProperty
https://bugs.webkit.org/show_bug.cgi?id=154314

Reviewed by Filip Pizlo.

This patch implements Proxy.GetOwnProperty.
It's a straight forward implementation as described
in section 9.5.5 of the specification:
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p

  • runtime/FunctionPrototype.cpp:

(JSC::functionProtoFuncBind):

  • runtime/JSObject.cpp:

(JSC::validateAndApplyPropertyDescriptor):
(JSC::JSObject::defineOwnNonIndexProperty):
(JSC::JSObject::defineOwnProperty):
(JSC::JSObject::getGenericPropertyNames):
(JSC::JSObject::getMethod):

  • runtime/JSObject.h:

(JSC::JSObject::butterflyAddress):
(JSC::makeIdentifier):

  • runtime/ProxyObject.cpp:

(JSC::performProxyGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::getOwnPropertySlotCommon):
(JSC::ProxyObject::getOwnPropertySlot):
(JSC::ProxyObject::getOwnPropertySlotByIndex):
(JSC::ProxyObject::visitChildren):

  • runtime/ProxyObject.h:
  • tests/es6.yaml:
  • tests/stress/proxy-basic.js:

(let.handler.get null):

  • tests/stress/proxy-get-own-property.js: Added.

(assert):
(throw.new.Error.let.handler.getOwnPropertyDescriptor):
(throw.new.Error):
(let.handler.getOwnPropertyDescriptor):
(i.catch):
(assert.let.handler.getOwnPropertyDescriptor):

File:
1 edited

Legend:

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

    r196722 r196772  
    6464    static void visitChildren(JSCell*, SlotVisitor&);
    6565
    66     bool getOwnPropertySlotCommon(ExecState*, PropertySlot&);
     66    bool getOwnPropertySlotCommon(ExecState*, PropertyName, PropertySlot&);
     67    bool performInternalMethodGetOwnProperty(ExecState*, PropertyName, PropertySlot&);
    6768
    6869    WriteBarrier<JSObject> m_target;
Note: See TracChangeset for help on using the changeset viewer.