Ignore:
Timestamp:
Jun 24, 2014, 1:29:27 PM (11 years ago)
Author:
[email protected]
Message:

REGRESSION (r169703): Invalid cast in JSC::asGetterSetter / JSC::JSObject::defineOwnNonIndexProperty
https://bugs.webkit.org/show_bug.cgi?id=134046

Reviewed by Filip Pizlo.

  • runtime/GetterSetter.h:

(JSC::asGetterSetter):

  • runtime/JSObject.cpp:

(JSC::JSObject::defineOwnNonIndexProperty): We need to check for a CustomGetterSetter here as well as
a normal GetterSetter. If we encounter a CustomGetterSetter, we delete it, create a new normal GetterSetter,
and insert it like normal. We also need to check for CustomAccessors when checking for unconfigurable properties.

File:
1 edited

Legend:

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

    r170256 r170386  
    26472647            return false;
    26482648        }
     2649        if (current.attributes() & CustomAccessor) {
     2650            if (throwException)
     2651                exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change access mechanism for an unconfigurable property.")));
     2652            return false;
     2653        }
    26492654    }
    26502655    JSValue accessor = getDirect(exec->vm(), propertyName);
    26512656    if (!accessor)
    26522657        return false;
    2653     GetterSetter* getterSetter = asGetterSetter(accessor);
     2658    GetterSetter* getterSetter;
     2659    if (accessor.isCustomGetterSetter())
     2660        getterSetter = GetterSetter::create(exec->vm());
     2661    else {
     2662        ASSERT(accessor.isGetterSetter());
     2663        getterSetter = asGetterSetter(accessor);
     2664    }
    26542665    if (descriptor.setterPresent())
    26552666        getterSetter->setSetter(exec->vm(), descriptor.setterObject());
Note: See TracChangeset for help on using the changeset viewer.