summaryrefslogtreecommitdiffstats
path: root/src/script/bridge
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-15 09:15:51 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-15 09:15:51 (GMT)
commit630444819350b9f7a31c34798405c4e6fd53dc62 (patch)
tree4a4bc6469d387283411a9d97dd924340a1749058 /src/script/bridge
parent54fada24d47acf7b19ec175041fabdb0b1dfe38f (diff)
downloadQt-630444819350b9f7a31c34798405c4e6fd53dc62.zip
Qt-630444819350b9f7a31c34798405c4e6fd53dc62.tar.gz
Qt-630444819350b9f7a31c34798405c4e6fd53dc62.tar.bz2
implement AutoCreateDynamicProperties option
Diffstat (limited to 'src/script/bridge')
-rw-r--r--src/script/bridge/qscriptqobject.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index e668df3..3705e5f 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -1314,13 +1314,6 @@ void QObjectDelegate::put(QScriptObject *object, JSC::ExecState* exec,
}
}
- index = qobject->dynamicPropertyNames().indexOf(name);
- if (index != -1) {
- QVariant v = eng->scriptValueFromJSCValue(value).toVariant();
- (void)qobject->setProperty(name, v);
- return;
- }
-
const int offset = (opt & QScriptEngine::ExcludeSuperClassMethods)
? meta->methodOffset() : 0;
for (index = meta->methodCount() - 1; index >= offset; --index) {
@@ -1332,6 +1325,13 @@ void QObjectDelegate::put(QScriptObject *object, JSC::ExecState* exec,
}
}
+ index = qobject->dynamicPropertyNames().indexOf(name);
+ if ((index != -1) || (opt & QScriptEngine::AutoCreateDynamicProperties)) {
+ QVariant v = eng->scriptValueFromJSCValue(value).toVariant();
+ (void)qobject->setProperty(name, v);
+ return;
+ }
+
QScriptObjectDelegate::put(object, exec, propertyName, value, slot);
}