Ignore:
Timestamp:
Mar 1, 2016, 3:42:33 PM (9 years ago)
Author:
[email protected]
Message:

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

Reviewed by Oliver Hunt.

This patch is a direct implementation of Proxy.PreventExtensions with respect to section 9.5.4
of the ECMAScript 6 spec.
https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-preventextensions

  • runtime/ProxyObject.cpp:

(JSC::ProxyObject::deletePropertyByIndex):
(JSC::ProxyObject::performPreventExtensions):
(JSC::ProxyObject::preventExtensions):
(JSC::ProxyObject::visitChildren):

  • runtime/ProxyObject.h:
  • tests/es6.yaml:
  • tests/stress/proxy-prevent-extensions.js: Added.

(assert):
(throw.new.Error.let.handler.get preventExtensions):
(throw.new.Error):
(assert.let.handler.preventExtensions):
(assert.):
(let.handler.preventExtensions):
(assert.Object.isSealed.let.handler.preventExtensions):
(assert.Object.isSealed):

File:
1 edited

Legend:

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

    r197136 r197418  
    7070    static bool deleteProperty(JSCell*, ExecState*, PropertyName);
    7171    static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned propertyName);
     72    static bool preventExtensions(JSObject*, ExecState*);
    7273    static void visitChildren(JSCell*, SlotVisitor&);
    7374
     
    7980    template <typename PerformDefaultPutFunction>
    8081    void performPut(ExecState*, JSValue putValue, JSValue thisValue, PropertyName, PerformDefaultPutFunction);
     82    bool performPreventExtensions(ExecState*);
    8183
    8284    WriteBarrier<JSObject> m_target;
Note: See TracChangeset for help on using the changeset viewer.