diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-06-25 03:11:09 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-06-25 03:11:09 (GMT) |
commit | 2426502f372f1c1a33ccaba3549dc0eda2a754de (patch) | |
tree | 8a9ec929e44395703bdb15d290ce170e69f800ab /src/declarative/qml/qdeclarativeglobalscriptclass.cpp | |
parent | cfa9eee32081dc49ab0697b1f483db01c8aee7cd (diff) | |
download | Qt-2426502f372f1c1a33ccaba3549dc0eda2a754de.zip Qt-2426502f372f1c1a33ccaba3549dc0eda2a754de.tar.gz Qt-2426502f372f1c1a33ccaba3549dc0eda2a754de.tar.bz2 |
Disallow global object properties as property names
QTBUG-11605
Diffstat (limited to 'src/declarative/qml/qdeclarativeglobalscriptclass.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativeglobalscriptclass.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp index f29b3f4..3e22c82 100644 --- a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp @@ -55,6 +55,7 @@ QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(QScriptEngine *engi : QScriptClass(engine) { QString eval = QLatin1String("eval"); + QString version = QLatin1String("version"); QScriptValue globalObject = engine->globalObject(); @@ -68,6 +69,9 @@ QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(QScriptEngine *engi QString name = iter.name(); + if (name == version) + continue; + if (name != eval) m_globalObject.setProperty(iter.scriptName(), iter.value()); newGlobalObject.setProperty(iter.scriptName(), iter.value()); |