diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-10-06 10:52:58 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-10-06 11:01:41 (GMT) |
commit | 13cf7c64acd1652bad90966e06464b35b84e9513 (patch) | |
tree | e9032c60a2b4f00feb452e7df7e0c11c51583b16 /src/script/api | |
parent | a6ed1f886d323d68001e3e1b50efe064073691ea (diff) | |
download | Qt-13cf7c64acd1652bad90966e06464b35b84e9513.zip Qt-13cf7c64acd1652bad90966e06464b35b84e9513.tar.gz Qt-13cf7c64acd1652bad90966e06464b35b84e9513.tar.bz2 |
implement property getters&setters for setProperty(quint32) overload
It's better that this works rather than asserts.
Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index f2716e4..92c987c 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1738,7 +1738,7 @@ QScriptValue QScriptValue::property(quint32 arrayIndex, void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value, const PropertyFlags &flags) { - Q_D(const QScriptValue); + Q_D(QScriptValue); if (!d || !d->isObject()) return; if (value.engine() && (value.engine() != engine())) { @@ -1752,7 +1752,9 @@ void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value, JSC::asObject(d->jscValue)->deleteProperty(exec, arrayIndex, /*checkDontDelete=*/false); } else { if ((flags & QScriptValue::PropertyGetter) || (flags & QScriptValue::PropertySetter)) { - Q_ASSERT_X(false, Q_FUNC_INFO, "property getters and setters not implemented"); + // fall back to string-based setProperty(), since there is no + // JSC::JSObject::defineGetter(unsigned) + d->setProperty(JSC::Identifier::from(exec, arrayIndex), value, flags); } else { if (flags != QScriptValue::KeepExistingFlags) { // if (JSC::asObject(d->jscValue)->hasOwnProperty(exec, arrayIndex)) |