aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/v4/qv4global.h6
-rw-r--r--src/v4/qv4object.cpp6
2 files changed, 7 insertions, 5 deletions
diff --git a/src/v4/qv4global.h b/src/v4/qv4global.h
index 0e0a4f0f26..928664de0a 100644
--- a/src/v4/qv4global.h
+++ b/src/v4/qv4global.h
@@ -102,13 +102,15 @@ struct PropertyAttributes
PropertyAttributes() : m_all(0) {}
PropertyAttributes(PropertyFlag f) : m_all(0) {
setType(f & Attr_Accessor ? Accessor : Data);
- setWritable(!(f & Attr_NotWritable));
+ if (!(f & Attr_Accessor))
+ setWritable(!(f & Attr_NotWritable));
setEnumerable(!(f & Attr_NotEnumerable));
setConfigurable(!(f & Attr_NotConfigurable));
}
PropertyAttributes(PropertyFlags f) : m_all(0) {
setType(f & Attr_Accessor ? Accessor : Data);
- setWritable(!(f & Attr_NotWritable));
+ if (!(f & Attr_Accessor))
+ setWritable(!(f & Attr_NotWritable));
setEnumerable(!(f & Attr_NotEnumerable));
setConfigurable(!(f & Attr_NotConfigurable));
}
diff --git a/src/v4/qv4object.cpp b/src/v4/qv4object.cpp
index 68f7c9ac0e..105af27517 100644
--- a/src/v4/qv4object.cpp
+++ b/src/v4/qv4object.cpp
@@ -192,7 +192,7 @@ void Object::inplaceBinOp(ExecutionContext *ctx, BinOp op, const Value &index, c
void Object::defineDefaultProperty(String *name, Value value)
{
- PropertyDescriptor *pd = insertMember(name, Attr_Data);
+ PropertyDescriptor *pd = insertMember(name, Attr_Data|Attr_NotEnumerable);
pd->attrs = Attr_Data|Attr_NotEnumerable;
pd->value = value;
}
@@ -658,8 +658,8 @@ bool Object::__defineOwnProperty__(ExecutionContext *ctx, String *name, const Pr
ctx->throwRangeError(desc->value);
succeeded = setArrayLength(l);
}
- if (desc->attrs.hasWritable())
- lp->attrs.setWritable(desc->attrs.isWritable());
+ if (desc->attrs.hasWritable() && !desc->attrs.isWritable())
+ lp->attrs.setWritable(false);
if (!succeeded)
goto reject;
return true;