Ignore:
Timestamp:
Mar 1, 2016, 12:11:20 AM (9 years ago)
Author:
[email protected]
Message:

PreventExtensions should be a virtual method in the method table.
https://bugs.webkit.org/show_bug.cgi?id=154800

Reviewed by Yusuke Suzuki.

This patch makes us more consistent with how the ES6 specification models the
PreventExtensions trap. Moving this method into ClassInfo::methodTable
is a prerequisite for implementing Proxy.PreventExtensions.

  • runtime/ClassInfo.h:
  • runtime/JSCell.cpp:

(JSC::JSCell::getGenericPropertyNames):
(JSC::JSCell::preventExtensions):

  • runtime/JSCell.h:
  • runtime/JSModuleNamespaceObject.cpp:

(JSC::JSModuleNamespaceObject::JSModuleNamespaceObject):
(JSC::JSModuleNamespaceObject::finishCreation):
(JSC::JSModuleNamespaceObject::destroy):

  • runtime/JSModuleNamespaceObject.h:

(JSC::JSModuleNamespaceObject::create):
(JSC::JSModuleNamespaceObject::moduleRecord):

  • runtime/JSObject.cpp:

(JSC::JSObject::freeze):
(JSC::JSObject::preventExtensions):
(JSC::JSObject::reifyAllStaticProperties):

  • runtime/JSObject.h:

(JSC::JSObject::isSealed):
(JSC::JSObject::isFrozen):
(JSC::JSObject::isExtensible):

  • runtime/ObjectConstructor.cpp:

(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorPreventExtensions):
(JSC::objectConstructorIsSealed):

  • runtime/ReflectObject.cpp:

(JSC::reflectObjectPreventExtensions):

  • runtime/Structure.cpp:

(JSC::Structure::Structure):
(JSC::Structure::preventExtensionsTransition):

  • runtime/Structure.h:
File:
1 edited

Legend:

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

    r197379 r197391  
    103103    typedef PassRefPtr<ArrayBufferView> (*GetTypedArrayImpl)(JSArrayBufferView*);
    104104    GetTypedArrayImpl getTypedArrayImpl;
     105
     106    typedef bool (*PreventExtensionsFunctionPtr)(JSObject*, ExecState*);
     107    PreventExtensionsFunctionPtr preventExtensions;
    105108
    106109    typedef void (*DumpToStreamFunctionPtr)(const JSCell*, PrintStream&);
     
    155158        &ClassName::slowDownAndWasteMemory, \
    156159        &ClassName::getTypedArrayImpl, \
     160        &ClassName::preventExtensions, \
    157161        &ClassName::dumpToStream, \
    158162        &ClassName::estimatedSize \
Note: See TracChangeset for help on using the changeset viewer.