diff options
author | Simon Hausmann <[email protected]> | 2014-04-10 12:58:15 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-04-17 07:09:54 +0200 |
commit | 37e4975e5f43a85e81109b115bfe10d371d0bf89 (patch) | |
tree | be5d98fa38a782ae91f2798c1a89a381e23e26d9 /src/qml/jsruntime | |
parent | 6572d4e50d73ac60a8974d07de74c27a7f99ebef (diff) |
Refine fix for dynamic properties on QObjects wrapped in JavaScript
This is an ammendment to commit 60730cbb5e5475b5db6a15641211aa6958a93197
to further restrict the ability to set dynamic properties on JS wrapped
QObjects only on those that are associated with a qml context. Only one
such association comes with the static property lookup rules of QML and
therefore only those should be prohibited from dynamic properties.
The previous implementation on using the "compiledData" field to detect QML
association or not is not strong and reliable enough.
Change-Id: I10c0e6e58a2727c01a6cb56fdf912bf250333e1f
Reviewed-by: Jędrzej Nowacki <[email protected]>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index de556dc9ed..b61be913a6 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -685,7 +685,7 @@ void QObjectWrapper::put(Managed *m, const StringRef name, const ValueRef value) QQmlData *ddata = QQmlData::get(that->m_object); // Types created by QML are not extensible at run-time, but for other QObjects we can store them // as regular JavaScript properties, like on JavaScript objects. - if (ddata && ddata->compiledData) { + if (ddata && ddata->context) { QString error = QLatin1String("Cannot assign to non-existent property \"") + name->toQString() + QLatin1Char('\"'); v4->currentContext()->throwError(error); |