void PropertyDescriptor::setCustomDescriptor(unsigned attributes)
{
    ASSERT(!(attributes & PropertyAttribute::CustomValue));
    m_attributes = attributes | PropertyAttribute::Accessor | PropertyAttribute::CustomAccessor;
    m_attributes &= ~PropertyAttribute::ReadOnly;
    m_seenAttributes = EnumerablePresent | ConfigurablePresent;
    setGetter(jsUndefined());
    setSetter(jsUndefined());
    m_value = JSValue();
}
Example #2
0
GetterSetter* GetterSetter::withGetter(VM& vm, JSGlobalObject* globalObject, JSObject* newGetter)
{
    if (isGetterNull()) {
        setGetter(vm, globalObject, newGetter);
        return this;
    }
    
    GetterSetter* result = GetterSetter::create(vm, globalObject);
    result->setGetter(vm, globalObject, newGetter);
    result->setSetter(vm, globalObject, setter());
    return result;
}