aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-25 15:24:50 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-28 13:33:39 +0200
commit150731fc68bcf823bec40729285813d902990cb7 (patch)
tree7af619f4bc8fac030bc162ce6ead2e2a7be86783 /src/qml/jsapi
parentc79cc3f30d395c94d4f14b978903d7db4ad871dc (diff)
Remove more direct QV4::Value usage
Remove Value::fromString(String *), and make Encode safe against encoding raw Managed * pointers. Change-Id: Ibca4668e1cbeaf85c78169d14386281659d33ef6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsapi')
-rw-r--r--src/qml/jsapi/qjsvalue.cpp2
-rw-r--r--src/qml/jsapi/qjsvalue_p.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp
index 2afeff0a07..5805b6a78f 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -508,7 +508,7 @@ QJSValue QJSValue::call(const QJSValueList &args)
Scope scope(engine);
ScopedCallData callData(scope, args.length());
- callData->thisObject = Encode(engine->globalObject);
+ callData->thisObject = engine->globalObject->asReturnedValue();
for (int i = 0; i < args.size(); ++i) {
if (!args.at(i).d->checkEngine(engine)) {
qWarning("QJSValue::call() failed: cannot call function with argument created in a different engine");
diff --git a/src/qml/jsapi/qjsvalue_p.h b/src/qml/jsapi/qjsvalue_p.h
index ec3f61ef20..bf839a6f1f 100644
--- a/src/qml/jsapi/qjsvalue_p.h
+++ b/src/qml/jsapi/qjsvalue_p.h
@@ -83,7 +83,7 @@ public:
: PersistentValuePrivate(QV4::Encode::undefined())
, string(0, s)
{
- value = QV4::Value::fromString(&string);
+ value.val = QV4::Encode(string.asReturned<QV4::String>());
}
QV4::ReturnedValue getValue(QV4::ExecutionEngine *e);