Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Ensure JS files imported inside modules work correctly
When a module exports functionality provided by a script, ensure that imported script modules inside that script resolve correctly. Task-number: QTBUG-24596 Change-Id: I3885dcc56946423f0d7cf00afdcdfaa0cb11967a Reviewed-by: Chris Adams <christopher.adams@nokia.com>
- Loading branch information
Matthew Vogt
authored and
Qt by Nokia
committed
Mar 19, 2012
1 parent
601c738
commit c5cd60a
Showing
11 changed files
with
105 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/auto/qml/qqmlecmascript/data/jsimport/testJsImport.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import QtQuick 2.0 | ||
|
||
import com.nokia.JsModule 1.0 | ||
import com.nokia.JsModule 1.0 as RenamedModule | ||
import "testJsModuleImport.js" as TestJsModuleImport | ||
|
||
QtObject { | ||
id: testQtObject | ||
|
||
property string importedScriptStringValue: ScriptAPI.greeting(); | ||
property string renamedScriptStringValue: RenamedModule.ScriptAPI.greeting(); | ||
property string reimportedScriptStringValue: TestJsModuleImport.importedValue(); | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/auto/qml/qqmlecmascript/data/jsimport/testJsModuleImport.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.import com.nokia.JsModule 1.0 as JsModule | ||
|
||
function importedValue() { | ||
return JsModule.ScriptAPI.greeting(); | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/auto/qml/qqmlecmascript/data/lib/com/nokia/JsModule/ScriptAPI.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var major = 1 | ||
var minor = 0 | ||
|
||
function greeting() { return "Hello" } | ||
|
1 change: 1 addition & 0 deletions
1
tests/auto/qml/qqmlecmascript/data/lib/com/nokia/JsModule/qmldir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ScriptAPI 1.0 ScriptAPI.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters