aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2012-11-15 12:23:39 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-15 13:40:55 +0100
commit4810e095b7940de875eb6d9d8a907e632ede561d (patch)
tree89df2e883a55073b70b7030f9442076acc05ec90 /main.cpp
parent1cbec5b889fb29732337c4db3f3f1fef1241f65b (diff)
Store the activation object as a pointer, not as a Value.
The activation object inside the context is always an object, or null. This avoids some needless conversions to and from Value's. Change-Id: Ibbd88c83fa073a4ed3cf03742129357dd9567cec Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.cpp b/main.cpp
index 8b1b0ac53b..2b69a4ffb0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -282,11 +282,11 @@ static int evaluate(QQmlJS::VM::Context *ctx, const QString &fileName,
return EXIT_FAILURE;
}
- if (! ctx->activation.isObject())
- ctx->activation = VM::Value::fromObject(new QQmlJS::VM::Object());
+ if (!ctx->activation)
+ ctx->activation = new QQmlJS::VM::Object();
foreach (const QString *local, globalCode->locals) {
- ctx->activation.objectValue()->__put__(ctx, *local, QQmlJS::VM::Value::undefinedValue());
+ ctx->activation->__put__(ctx, *local, QQmlJS::VM::Value::undefinedValue());
}
void * buf = __qmljs_create_exception_handler(ctx);