aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/include_pragma_shadow.js
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-03-09 15:24:49 +0100
committerLiang Qi <liang.qi@qt.io>2018-06-17 20:06:16 +0000
commit9333ea8649838d7e0400b0e94c8cbd4fa5d216b0 (patch)
tree08a750b6afa315ac16ea855a87a1d1d18afe30e3 /tests/auto/qml/qqmlecmascript/data/include_pragma_shadow.js
parent6b77f0eb99a33b46000ac66ec297082527009d5d (diff)
Ensure we read context properties before the global object
Also global variables declared in a .pragma library script should not be saved in the global object, as the script has it's on context where those variables live. [ChangeLog][QtQml] Properties of the JS global object will now be looked up after local properties in the QML object. This can lead to runtime incompatibilities if your qml file is named the same as a property of the global object (e.g. Date.qml). Task-number: QTBUG-51581 Change-Id: I108aea4c76d088ca8c2124700f91e8eac3fc19f3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/include_pragma_shadow.js')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/include_pragma_shadow.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/include_pragma_shadow.js b/tests/auto/qml/qqmlecmascript/data/include_pragma_shadow.js
new file mode 100644
index 0000000000..500f04bec7
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/include_pragma_shadow.js
@@ -0,0 +1,7 @@
+.pragma library
+var Shadowed = 2;
+var global = (function(){return this})()
+
+// set Shadowed on the global object as well. This should be different from
+// the variable above, as the library has it's on context
+global.Shadowed = 1;