Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
4.7.0
-
None
Description
If I have a QML file like:
import Qt 4.7
import "a.js" as A
import "b.js" as B
Item {
}
and a.js looks like:
.pragma library
var foo = "foo";
and b.js looks like:
.pragma library
console.log(foo);
I get undefined printed from b.js when running the QML file. By changing b.js to:
.pragma library
console.log(A.foo);
I get:
TypeError: Result of expression 'A' [undefined] is not an object.
I would expect that there would be some way for imported JS files to reference each other.