diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 14:36:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:21 +0200 |
commit | 002e6105f61269f1474de878ccdb26205e5b226e (patch) | |
tree | ead1d10b7d8aa2537e7073327d9d0d9ce591c995 /src/qml/jsruntime/qv4jsonobject.cpp | |
parent | 1a2a83f80ba4ecc28eba72af57c81bd43a45946c (diff) |
Require a ValueScope for ScopedCallData as well
This brings things more in line with ScopedValue, and
also simplifies cleanup of Scoped values.
Change-Id: If5f1466b4e13c629d56c1e7c638937f61ba48f77
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4jsonobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4jsonobject.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 3048d00ddb..12508d77cd 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -698,12 +698,13 @@ static QString quote(const QString &str) QString Stringify::Str(const QString &key, Value value) { + ValueScope scope(ctx); QString result; if (Object *o = value.asObject()) { FunctionObject *toJSON = o->get(ctx->engine->newString(QStringLiteral("toJSON"))).asFunctionObject(); if (toJSON) { - ScopedCallData callData(ctx->engine, 1); + ScopedCallData callData(scope, 1); callData->thisObject = value; callData->args[0] = Value::fromString(ctx, key); value = Value::fromReturnedValue(toJSON->call(callData)); @@ -714,7 +715,7 @@ QString Stringify::Str(const QString &key, Value value) Object *holder = ctx->engine->newObject(); Value holderValue = Value::fromObject(holder); holder->put(ctx, QString(), value); - ScopedCallData callData(ctx->engine, 2); + ScopedCallData callData(scope, 2); callData->args[0] = Value::fromString(ctx, key); callData->args[1] = value; callData->thisObject = holderValue; |