aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4jsonobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-05 13:22:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-11 13:01:50 +0200
commit6e8e5d16e16d6ee683a5c06a24f8f202ed5239ff (patch)
treefa8e710ad0ee4ff6cc9738fa717883c74d452b95 /src/qml/jsruntime/qv4jsonobject.cpp
parent736afb8e9b3694efb8ca1fa8f3a8eeeaef530da2 (diff)
Move CallData onto the JS stack
Change-Id: I22e853acfd2da337344b581bb0412c5f9930c510 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4jsonobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp
index 9c98d78743..82c7e8caed 100644
--- a/src/qml/jsruntime/qv4jsonobject.cpp
+++ b/src/qml/jsruntime/qv4jsonobject.cpp
@@ -44,6 +44,7 @@
#include <qv4stringobject_p.h>
#include <qv4booleanobject_p.h>
#include <qv4objectiterator_p.h>
+#include <qv4scopedvalue_p.h>
#include <qjsondocument.h>
#include <qstack.h>
#include <qstringlist.h>
@@ -702,10 +703,10 @@ QString Stringify::Str(const QString &key, Value value)
if (Object *o = value.asObject()) {
FunctionObject *toJSON = o->get(ctx->engine->newString(QStringLiteral("toJSON"))).asFunctionObject();
if (toJSON) {
- CALLDATA(1);
- d.thisObject = value;
- d.args[0] = Value::fromString(ctx, key);
- value = toJSON->call(d);
+ ScopedCallData callData(ctx->engine, 1);
+ callData->thisObject = value;
+ callData->args[0] = Value::fromString(ctx, key);
+ value = toJSON->call(callData);
}
}
@@ -713,11 +714,11 @@ QString Stringify::Str(const QString &key, Value value)
Object *holder = ctx->engine->newObject();
Value holderValue = Value::fromObject(holder);
holder->put(ctx, QString(), value);
- CALLDATA(2);
- d.args[0] = Value::fromString(ctx, key);
- d.args[1] = value;
- d.thisObject = holderValue;
- value = replacerFunction->call(d);
+ ScopedCallData callData(ctx->engine, 2);
+ callData->args[0] = Value::fromString(ctx, key);
+ callData->args[1] = value;
+ callData->thisObject = holderValue;
+ value = replacerFunction->call(callData);
}
if (Object *o = value.asObject()) {