Skip to content

Commit

Permalink
Fix regression against 4.7
Browse files Browse the repository at this point in the history
Task-number: QTBUG-19136
  • Loading branch information
Aaron Kennedy committed Jun 23, 2011
1 parent f153846 commit b35d6b4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/declarative/qml/qdeclarativevme.cpp
Expand Up @@ -988,6 +988,7 @@ QScriptValue QDeclarativeVME::run(QDeclarativeContextData *parentCtxt, QDeclarat
ctxt->imports = script->importCache;
} else {
ctxt->imports = parentCtxt->imports;
ctxt->importedScripts = parentCtxt->importedScripts;
}

if (ctxt->imports) {
Expand Down
@@ -0,0 +1 @@
var value = 240
@@ -0,0 +1,3 @@
function getValue() {
return ImportScope1.value
}
@@ -0,0 +1,7 @@
import QtQuick 1.0
import "importScope.1.js" as ImportScope1
import "importScope.2.js" as ImportScope2

QtObject {
property int test: ImportScope2.getValue()
}
Expand Up @@ -108,6 +108,7 @@ private slots:
void aliasPropertyAndBinding();
void nonExistentAttachedObject();
void scope();
void importScope();
void signalParameterTypes();
void objectsCompareAsEqual();
void dynamicCreation_data();
Expand Down Expand Up @@ -959,6 +960,19 @@ void tst_qdeclarativeecmascript::scope()
}
}

// In 4.7, non-library javascript files that had no imports shared the imports of their
// importing context
void tst_qdeclarativeecmascript::importScope()
{
QDeclarativeComponent component(&engine, TEST_FILE("importScope.qml"));
QObject *o = component.create();
QVERIFY(o != 0);

QCOMPARE(o->property("test").toInt(), 240);

delete o;
}

/*
Tests that "any" type passes through a synthesized signal parameter. This
is essentially a test of QDeclarativeMetaType::copy()
Expand Down

0 comments on commit b35d6b4

Please sign in to comment.