Fix tst_qqmlecmascript::callQtInvokables
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 13 Jun 2013 06:53:34 +0000 (08:53 +0200)
committerLars Knoll <lars.knoll@digia.com>
Thu, 13 Jun 2013 06:55:21 +0000 (08:55 +0200)
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 <lars.knoll@digia.com>
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

index d77c775..ca7c95c 100644 (file)
@@ -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)