members.reset(new PropertyTable());
PropertyDescriptor *pd = members->insert(name);
pd->type = PropertyDescriptor::Data;
- pd->writable = PropertyDescriptor::Set;
- pd->enumberable = PropertyDescriptor::Unset;
- pd->configurable = PropertyDescriptor::Set;
+ pd->writable = PropertyDescriptor::Enabled;
+ pd->enumberable = PropertyDescriptor::Disabled;
+ pd->configurable = PropertyDescriptor::Enabled;
pd->value = value;
}
members.reset(new PropertyTable());
PropertyDescriptor *pd = members->insert(engine->identifier(name));
pd->type = PropertyDescriptor::Data;
- pd->writable = PropertyDescriptor::Unset;
- pd->enumberable = PropertyDescriptor::Unset;
- pd->configurable = PropertyDescriptor::Unset;
+ pd->writable = PropertyDescriptor::Disabled;
+ pd->enumberable = PropertyDescriptor::Disabled;
+ pd->configurable = PropertyDescriptor::Disabled;
pd->value = value;
}
PropertyDescriptor *p = members->insert(name);
*p = PropertyDescriptor::fromValue(value);
- p->configurable = PropertyDescriptor::Set;
- p->enumberable = PropertyDescriptor::Set;
- p->writable = PropertyDescriptor::Set;
+ p->configurable = PropertyDescriptor::Enabled;
+ p->enumberable = PropertyDescriptor::Enabled;
+ p->writable = PropertyDescriptor::Enabled;
return;
}
} else {
// 9c
current->type = PropertyDescriptor::Data;
- current->writable = PropertyDescriptor::Unset;
+ current->writable = PropertyDescriptor::Disabled;
current->value = Value::undefinedValue();
}
} else if (current->isData() && desc->isData()) { // clause 10
const quint32 i = Value::fromString(name).toUInt32(ctx);
if (i < context->argumentCount) {
*to_fill = PropertyDescriptor::fromValue(context->argument(i));
- to_fill->writable = PropertyDescriptor::Unset;
- to_fill->enumberable = PropertyDescriptor::Unset;
+ to_fill->writable = PropertyDescriptor::Disabled;
+ to_fill->enumberable = PropertyDescriptor::Disabled;
return to_fill;
}
}
if (o->members) {
PropertyTable::iterator it = o->members->begin();
while (it != o->members->end()) {
- (*it)->descriptor.configurable = PropertyDescriptor::Unset;
+ (*it)->descriptor.configurable = PropertyDescriptor::Disabled;
++it;
}
}
PropertyTable::iterator it = o->members->begin();
while (it != o->members->end()) {
if ((*it)->descriptor.isData())
- (*it)->descriptor.writable = PropertyDescriptor::Unset;
- (*it)->descriptor.configurable = PropertyDescriptor::Unset;
+ (*it)->descriptor.writable = PropertyDescriptor::Disabled;
+ (*it)->descriptor.configurable = PropertyDescriptor::Disabled;
++it;
}
}
if (o->members) {
PropertyTable::iterator it = o->members->begin();
while (it != o->members->end()) {
- if ((*it)->descriptor.configurable != PropertyDescriptor::Unset)
+ if ((*it)->descriptor.configurable != PropertyDescriptor::Disabled)
return Value::fromBoolean(false);
++it;
}
PropertyTable::iterator it = o->members->begin();
while (it != o->members->end()) {
if ((*it)->descriptor.isData() &&
- ((*it)->descriptor.writable != PropertyDescriptor::Unset))
+ ((*it)->descriptor.writable != PropertyDescriptor::Disabled))
return Value::fromBoolean(false);
- if ((*it)->descriptor.configurable != PropertyDescriptor::Unset)
+ if ((*it)->descriptor.configurable != PropertyDescriptor::Disabled)
return Value::fromBoolean(false);
++it;
}
Object *o = ctx->thisObject.toObject(ctx).objectValue();
PropertyDescriptor pd = PropertyDescriptor::fromAccessor(f, 0);
- pd.writable = PropertyDescriptor::Set;
- pd.configurable = PropertyDescriptor::Set;
- pd.enumberable = PropertyDescriptor::Set;
+ pd.writable = PropertyDescriptor::Enabled;
+ pd.configurable = PropertyDescriptor::Enabled;
+ pd.enumberable = PropertyDescriptor::Enabled;
o->__defineOwnProperty__(ctx, prop, &pd);
return Value::undefinedValue();
}
Object *o = ctx->thisObject.toObject(ctx).objectValue();
PropertyDescriptor pd = PropertyDescriptor::fromAccessor(0, f);
- pd.writable = PropertyDescriptor::Set;
- pd.configurable = PropertyDescriptor::Set;
- pd.enumberable = PropertyDescriptor::Set;
+ pd.writable = PropertyDescriptor::Enabled;
+ pd.configurable = PropertyDescriptor::Enabled;
+ pd.enumberable = PropertyDescriptor::Enabled;
o->__defineOwnProperty__(ctx, prop, &pd);
return Value::undefinedValue();
}
desc->enumberable = PropertyDescriptor::Undefined;
if (o->__hasProperty__(ctx, ctx->engine->id_enumerable))
- desc->enumberable = __qmljs_to_boolean(o->__get__(ctx, ctx->engine->id_enumerable), ctx) ? PropertyDescriptor::Set : PropertyDescriptor::Unset;
+ desc->enumberable = __qmljs_to_boolean(o->__get__(ctx, ctx->engine->id_enumerable), ctx) ? PropertyDescriptor::Enabled : PropertyDescriptor::Disabled;
desc->configurable = PropertyDescriptor::Undefined;
if (o->__hasProperty__(ctx, ctx->engine->id_configurable))
- desc->configurable = __qmljs_to_boolean(o->__get__(ctx, ctx->engine->id_configurable), ctx) ? PropertyDescriptor::Set : PropertyDescriptor::Unset;
+ desc->configurable = __qmljs_to_boolean(o->__get__(ctx, ctx->engine->id_configurable), ctx) ? PropertyDescriptor::Enabled : PropertyDescriptor::Disabled;
desc->get = 0;
if (o->__hasProperty__(ctx, ctx->engine->id_get)) {
if (o->__hasProperty__(ctx, ctx->engine->id_writable)) {
if (desc->isAccessor())
__qmljs_throw_type_error(ctx);
- desc->writable = __qmljs_to_boolean(o->__get__(ctx, ctx->engine->id_writable), ctx) ? PropertyDescriptor::Set : PropertyDescriptor::Unset;
+ desc->writable = __qmljs_to_boolean(o->__get__(ctx, ctx->engine->id_writable), ctx) ? PropertyDescriptor::Enabled : PropertyDescriptor::Disabled;
// writable forces it to be a data descriptor
desc->type = PropertyDescriptor::Data;
desc->value = Value::undefinedValue();
PropertyDescriptor pd;
pd.type = PropertyDescriptor::Data;
- pd.writable = PropertyDescriptor::Set;
- pd.enumberable = PropertyDescriptor::Set;
- pd.configurable = PropertyDescriptor::Set;
+ pd.writable = PropertyDescriptor::Enabled;
+ pd.enumberable = PropertyDescriptor::Enabled;
+ pd.configurable = PropertyDescriptor::Enabled;
if (desc->isData()) {
pd.value = desc->value;
o->__defineOwnProperty__(ctx, engine->identifier(QStringLiteral("value")), &pd);
- pd.value = Value::fromBoolean(desc->writable == PropertyDescriptor::Set ? true : false);
+ pd.value = Value::fromBoolean(desc->writable == PropertyDescriptor::Enabled ? true : false);
o->__defineOwnProperty__(ctx, engine->identifier(QStringLiteral("writable")), &pd);
} else {
pd.value = desc->get ? Value::fromObject(desc->get) : Value::undefinedValue();
pd.value = desc->set ? Value::fromObject(desc->set) : Value::undefinedValue();
o->__defineOwnProperty__(ctx, engine->identifier(QStringLiteral("set")), &pd);
}
- pd.value = Value::fromBoolean(desc->enumberable == PropertyDescriptor::Set ? true : false);
+ pd.value = Value::fromBoolean(desc->enumberable == PropertyDescriptor::Enabled ? true : false);
o->__defineOwnProperty__(ctx, engine->identifier(QStringLiteral("enumerable")), &pd);
- pd.value = Value::fromBoolean(desc->configurable == PropertyDescriptor::Set ? true : false);
+ pd.value = Value::fromBoolean(desc->configurable == PropertyDescriptor::Enabled ? true : false);
o->__defineOwnProperty__(ctx, engine->identifier(QStringLiteral("configurable")), &pd);
return Value::fromObject(o);