Ignore:
Timestamp:
Mar 3, 2016, 5:07:04 PM (9 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoffrey Garen and Mark Lam.

This patch is a straight forward implementation of Proxy.DefineOwnProperty
with respect to section 9.5.6 of the ECMAScript spec.
https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc

  • runtime/ObjectConstructor.cpp:

(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyDescriptors):

  • runtime/ObjectConstructor.h:

(JSC::constructEmptyObject):
(JSC::constructObjectFromPropertyDescriptor):

  • runtime/ProxyObject.cpp:

(JSC::ProxyObject::isExtensible):
(JSC::ProxyObject::performDefineOwnProperty):
(JSC::ProxyObject::defineOwnProperty):
(JSC::ProxyObject::visitChildren):

  • runtime/ProxyObject.h:
  • tests/es6.yaml:
  • tests/stress/proxy-define-own-property.js: Added.

(assert):
(throw.new.Error):
(assert.let.handler.get defineProperty):
(assert.let.handler.defineProperty):
(let.handler.defineProperty):
(i.catch):
(assert.try.):
(assert.set get catch):
(assert.let.setter):
(assert.let.getter):
(assert.set get let.handler.defineProperty):
(assert.set get let):
(assert.):

File:
1 edited

Legend:

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

    r197420 r197533  
    7272    static bool preventExtensions(JSObject*, ExecState*);
    7373    static bool isExtensible(JSObject*, ExecState*);
     74    static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool shouldThrow);
    7475    static void visitChildren(JSCell*, SlotVisitor&);
    7576
     
    8384    bool performPreventExtensions(ExecState*);
    8485    bool performIsExtensible(ExecState*);
     86    bool performDefineOwnProperty(ExecState*, PropertyName, const PropertyDescriptor&, bool shouldThrow);
    8587
    8688    WriteBarrier<JSObject> m_target;
Note: See TracChangeset for help on using the changeset viewer.