mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-22 05:09:43 +00:00
Forgot to use excnObj in db9c20e0a9. Also roots an additional jsval.
This was SVN commit r15518.
This commit is contained in:
@@ -425,8 +425,8 @@ void ErrorReporter(JSContext* cx, const char* message, JSErrorReport* report)
|
||||
msg << message;
|
||||
|
||||
// If there is an exception, then print its stack trace
|
||||
jsval excn;
|
||||
if (JS_GetPendingException(cx, &excn) && excn.isObject())
|
||||
JS::RootedValue excn(cx);
|
||||
if (JS_GetPendingException(cx, excn.address()) && excn.isObject())
|
||||
{
|
||||
JS::RootedObject excnObj(cx, &excn.toObject());
|
||||
// TODO: this violates the docs ("The error reporter callback must not reenter the JSAPI.")
|
||||
@@ -437,7 +437,7 @@ void ErrorReporter(JSContext* cx, const char* message, JSErrorReport* report)
|
||||
|
||||
JS::RootedValue rval(cx);
|
||||
const char dumpStack[] = "this.stack.trimRight().replace(/^/mg, ' ')"; // indent each line
|
||||
if (JS_EvaluateScript(cx, &excn.toObject(), dumpStack, ARRAY_SIZE(dumpStack)-1, "(eval)", 1, rval.address()))
|
||||
if (JS_EvaluateScript(cx, excnObj, dumpStack, ARRAY_SIZE(dumpStack)-1, "(eval)", 1, rval.address()))
|
||||
{
|
||||
std::string stackTrace;
|
||||
if (ScriptInterface::FromJSVal(cx, rval, stackTrace))
|
||||
|
||||
Reference in New Issue
Block a user