diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2014-11-07 18:51:19 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-11-12 12:13:26 +0100 |
commit | 31084c37f60a54d0d1ab2e07a79e070268540498 (patch) | |
tree | 598bf007edb899f6c0965e82b904bf7ba557d362 /src/qml/jsruntime/qv4objectproto.cpp | |
parent | 73a8f5f4845d34d74470b5a524d655be9eaf6dfc (diff) |
Convert methods in RuntimeHelpers to take an engine pointer
This is safer and cleaner than to use a context pointer.
Change-Id: Id5ef4e6667571897cd029125a0bdc18ce299da6d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index f3d8affb01..686d17877a 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -67,14 +67,14 @@ ReturnedValue ObjectCtor::construct(Managed *that, CallData *callData) obj->setPrototype(proto.getPointer()); return obj.asReturnedValue(); } - return RuntimeHelpers::toObject(v4->currentContext(), ValueRef(&callData->args[0])); + return RuntimeHelpers::toObject(scope.engine, ValueRef(&callData->args[0])); } ReturnedValue ObjectCtor::call(Managed *m, CallData *callData) { if (!callData->argc || callData->args[0].isUndefined() || callData->args[0].isNull()) return m->engine()->newObject()->asReturnedValue(); - return RuntimeHelpers::toObject(m->engine()->currentContext(), ValueRef(&callData->args[0])); + return RuntimeHelpers::toObject(m->engine(), ValueRef(&callData->args[0])); } void ObjectPrototype::init(ExecutionEngine *v4, Object *ctor) @@ -393,7 +393,7 @@ ReturnedValue ObjectPrototype::method_toString(CallContext *ctx) } else if (ctx->d()->callData->thisObject.isNull()) { return ctx->d()->engine->newString(QStringLiteral("[object Null]"))->asReturnedValue(); } else { - ScopedObject obj(scope, RuntimeHelpers::toObject(ctx, ValueRef(&ctx->d()->callData->thisObject))); + ScopedObject obj(scope, RuntimeHelpers::toObject(scope.engine, ValueRef(&ctx->d()->callData->thisObject))); QString className = obj->className(); return ctx->d()->engine->newString(QString::fromLatin1("[object %1]").arg(className))->asReturnedValue(); } |