diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-22 14:42:35 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-22 14:42:35 (GMT) |
commit | d6c6ac356d2e5dc6af1b368c89124143b161fc4e (patch) | |
tree | df3e076b4e08113bea007bc6e0b962f419668d99 /src | |
parent | e65c3ea459bac468024bbe08c5b841b36c82c547 (diff) | |
download | Qt-d6c6ac356d2e5dc6af1b368c89124143b161fc4e.zip Qt-d6c6ac356d2e5dc6af1b368c89124143b161fc4e.tar.gz Qt-d6c6ac356d2e5dc6af1b368c89124143b161fc4e.tar.bz2 |
More tests fixed (QScriptValue::toString)
Handle Exception in a toString function
Reviewed-by: Kent Hansen
Diffstat (limited to 'src')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 79c769a..b23ac2c 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1237,6 +1237,14 @@ QString QScriptValue::toString() const JSC::JSValue savedException; QScriptValuePrivate::saveException(exec, &savedException); JSC::UString str = d->jscValue.toString(exec); + if (exec && exec->hadException()) { + JSC::JSValue savedException2; + QScriptValuePrivate::saveException(exec, &savedException2); + if (!str.size()) + str = savedException2.toString(exec); + if (!eng_p->uncaughtException) + eng_p->uncaughtException = savedException2; + } QScriptValuePrivate::restoreException(exec, savedException); return QString(reinterpret_cast<const QChar*>(str.data()), str.size()); } |