From 7281cd44dcf538424acd58297801a79835f0cdfe Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 13 Jun 2013 08:53:34 +0200 Subject: [PATCH] Fix tst_qqmlecmascript::callQtInvokables Make sure to set inheritContext to true, to run the sample scripts the same way as we run QML right now: with lookups disabled. Lookups with custom get() don't work right now and cause the tests to fail lookup properties in QObject. Change-Id: I22a1133d5d568935c64fc5162445a438665713b8 Reviewed-by: Lars Knoll --- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index d77c775..ca7c95c 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -2171,6 +2171,7 @@ static inline bool evaluate_error(QV8Engine *engine, const QV4::Value &o, const QLatin1String(source) + QLatin1String(" })"); QV4::Script program(QV8Engine::getV4(engine)->rootContext, functionSource); + program.inheritContext = true; QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->current; @@ -2194,6 +2195,7 @@ static inline bool evaluate_value(QV8Engine *engine, const QV4::Value &o, QLatin1String(source) + QLatin1String(" })"); QV4::Script program(QV8Engine::getV4(engine)->rootContext, functionSource); + program.inheritContext = true; QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->current; try { @@ -2217,6 +2219,7 @@ static inline QV4::Value evaluate(QV8Engine *engine, const QV4::Value & o, QV4::ExecutionContext *ctx = QV8Engine::getV4(engine)->current; QV4::Script program(QV8Engine::getV4(engine)->rootContext, functionSource); + program.inheritContext = true; try { QV4::FunctionObject *function = program.run().asFunctionObject(); if (!function) -- 2.7.4