diff options
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 121658a..ee5b076 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2394,10 +2394,16 @@ QStringList QScriptEngine::uncaughtExceptionBacktrace() const { if (!hasUncaughtException()) return QStringList(); - qWarning("QScriptEngine::uncaughtExceptionBacktrace() not implemented"); -// ### implement me - // how do we get a bt with JSC? - return QStringList() << QLatin1String("<backtrace should go here>"); +// ### currently no way to get a full backtrace from JSC without installing a +// debugger that reimplements exception() and store the backtrace there. + QScriptValue value = uncaughtException(); + if (!value.isError()) + return QStringList(); + QStringList result; + result.append(QString::fromLatin1("<anonymous>()@%0:%1") + .arg(value.property(QLatin1String("fileName")).toString()) + .arg(value.property(QLatin1String("lineNumber")).toInt32())); + return result; } /*! |