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/Structure.cpp

    r197210 r197391  
    204204    setHasNonEnumerableProperties(false);
    205205    setAttributesInPrevious(0);
    206     setPreventExtensions(false);
     206    setDidPreventExtensions(false);
    207207    setDidTransition(false);
    208208    setStaticFunctionsReified(false);
     
    236236    setHasNonEnumerableProperties(false);
    237237    setAttributesInPrevious(0);
    238     setPreventExtensions(false);
     238    setDidPreventExtensions(false);
    239239    setDidTransition(false);
    240240    setStaticFunctionsReified(false);
     
    267267    setHasNonEnumerableProperties(previous->hasNonEnumerableProperties());
    268268    setAttributesInPrevious(0);
    269     setPreventExtensions(previous->preventExtensions());
     269    setDidPreventExtensions(previous->didPreventExtensions());
    270270    setDidTransition(true);
    271271    setStaticFunctionsReified(previous->staticFunctionsReified());
     
    626626    transition->propertyTable().set(vm, transition, structure->copyPropertyTableForPinning(vm));
    627627    transition->m_offset = structure->m_offset;
    628     transition->setPreventExtensions(true);
     628    transition->setDidPreventExtensions(true);
    629629    transition->pin();
    630630
Note: See TracChangeset for help on using the changeset viewer.