summaryrefslogtreecommitdiffstats
path: root/src/v4/qv4functionobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-04-08 15:38:30 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-04-12 14:25:21 +0200
commit1e87e39a1987da9f0ad454b8b4f6c40055e50799 (patch)
tree864b0405eb46e578045741883e03ad39532ac869 /src/v4/qv4functionobject.cpp
parent78bef0f2288de34f68525721733e43c769eb4496 (diff)
Change internal class when attributes of properties change
This should allow us to share property attributes for different class instances saving quite some memory. In addition, it can be used to speed up property access (as we then know in the lookup whether it's a data or accessor property). Change-Id: Ide9c6168a07b5c83a1e73d075d8fc4f6594e08fd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/v4/qv4functionobject.cpp')
-rw-r--r--src/v4/qv4functionobject.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/v4/qv4functionobject.cpp b/src/v4/qv4functionobject.cpp
index 0d8bac82..4deb3189 100644
--- a/src/v4/qv4functionobject.cpp
+++ b/src/v4/qv4functionobject.cpp
@@ -341,7 +341,7 @@ ScriptFunction::ScriptFunction(ExecutionContext *scope, Function *function)
Object *proto = scope->engine->newObject();
proto->defineDefaultProperty(scope->engine->id_constructor, Value::fromObject(this));
- PropertyDescriptor *pd = insertMember(scope->engine->id_prototype);
+ PropertyDescriptor *pd = insertMember(scope->engine->id_prototype, Attr_NotEnumerable|Attr_NotConfigurable);
pd->type = PropertyDescriptor::Data;
pd->writable = PropertyDescriptor::Enabled;
pd->enumerable = PropertyDescriptor::Disabled;
@@ -482,8 +482,8 @@ BoundFunction::BoundFunction(ExecutionContext *scope, FunctionObject *target, Va
PropertyDescriptor pd = PropertyDescriptor::fromAccessor(thrower, thrower);
pd.configurable = PropertyDescriptor::Disabled;
pd.enumerable = PropertyDescriptor::Disabled;
- *insertMember(scope->engine->id_arguments) = pd;
- *insertMember(scope->engine->id_caller) = pd;
+ *insertMember(scope->engine->id_arguments, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable) = pd;
+ *insertMember(scope->engine->id_caller, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable) = pd;
}
void BoundFunction::destroy(Managed *that)