diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-23 15:08:13 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-06-23 21:38:12 +0200 |
commit | 6c7969462a6ede2850927bc3d0c77f7785f4663e (patch) | |
tree | 40ebd5ecc741e6ecc7f845a0dbfe3bcefecfb951 /src/qml/qml/qqmlcontextwrapper.cpp | |
parent | 13d3954de41451536dfbd8c562a1a258cdc4cc71 (diff) |
Fix tst_qqmlecmascripts::importScripts with private imports
* In QQmlContextWrapper::get we must check the calling context before
allowing the get, just like in the Getter() in qv8contextwrapper.cpp
* When trying to call a method on undefined/null, throw a readable error message,
as expected by the test.
Change-Id: Ie39e8ae82a108deef264e4044e12e7b15959caf9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmlcontextwrapper.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp index 9ceb460dc3..6a3fd154d3 100644 --- a/src/qml/qml/qqmlcontextwrapper.cpp +++ b/src/qml/qml/qqmlcontextwrapper.cpp @@ -136,6 +136,9 @@ Value QmlContextWrapper::get(Managed *m, String *name, bool *hasProperty) if (resource->isNullWrapper) return Object::get(m, name, hasProperty); + if (QV4::QmlContextWrapper::callingContext(v4) != resource->context) + return Object::get(m, name, hasProperty); + bool hasProp; Value result = Object::get(m, name, &hasProp); if (hasProp) { |