Ignore:
Timestamp:
Jan 11, 2012, 7:53:22 PM (13 years ago)
Author:
[email protected]
Message:

Merge 'Getter'/'Setter' attributes into 'Accessor'
https://bugs.webkit.org/show_bug.cgi?id=76141

Reviewed by Filip Pizlo.

These are currently ambiguous (and used inconsistently). It would logically appear
that either being bit set implies that the corresponding type of accessor is present
but (a) we don't correctly enforce this, and (b) this means the attributes would not
be able to distinguish between a data descriptor and an accessor descriptor with
neither a getter nor setter defined (which is a descriptor permissible under the spec).
This ambiguity would lead to unsafe property caching behavior (though this does not
represent an actual current bug, since we are currently unable to create descriptors
that have neither a getter nor setter, it just prevents us from doing so).

  • runtime/Arguments.cpp:

(JSC::Arguments::createStrictModeCallerIfNecessary):
(JSC::Arguments::createStrictModeCalleeIfNecessary):

  • runtime/JSArray.cpp:

(JSC::SparseArrayValueMap::put):
(JSC::JSArray::putDescriptor):

  • runtime/JSBoundFunction.cpp:

(JSC::JSBoundFunction::finishCreation):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnPropertyDescriptor):

  • runtime/JSObject.cpp:

(JSC::JSObject::defineGetter):
(JSC::JSObject::initializeGetterSetterProperty):
(JSC::JSObject::defineSetter):
(JSC::putDescriptor):
(JSC::JSObject::defineOwnProperty):

  • runtime/JSObject.h:
  • runtime/ObjectConstructor.cpp:

(JSC::objectConstructorDefineProperty):

  • runtime/PropertyDescriptor.cpp:

(JSC::PropertyDescriptor::setDescriptor):
(JSC::PropertyDescriptor::setAccessorDescriptor):
(JSC::PropertyDescriptor::setSetter):
(JSC::PropertyDescriptor::setGetter):
(JSC::PropertyDescriptor::attributesOverridingCurrent):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSFunction.cpp

    r103958 r104784  
    217217            bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    218218            if (!result) {
    219                 thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);
     219                thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
    220220                result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    221221                ASSERT(result);
     
    236236            bool result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    237237            if (!result) {
    238                 thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);
     238                thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
    239239                result = Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
    240240                ASSERT(result);
     
    265265            bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    266266            if (!result) {
    267                 thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);
     267                thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
    268268                result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    269269                ASSERT(result);
     
    284284            bool result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    285285            if (!result) {
    286                 thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Getter | Setter);
     286                thisObject->initializeGetterSetterProperty(exec, propertyName, thisObject->globalObject()->throwTypeErrorGetterSetter(exec), DontDelete | DontEnum | Accessor);
    287287                result = Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
    288288                ASSERT(result);
Note: See TracChangeset for help on using the changeset viewer.