Attempts to fix StringifyJSON by clearing pending exceptions from JS API

This was SVN commit r13125.
This commit is contained in:
historic_bruno
2013-01-27 01:38:43 +00:00
parent 25928f1a8b
commit 1fdaca5cec
+2 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2012 Wildfire Games.
/* Copyright (C) 2013 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -1073,6 +1073,7 @@ std::string ScriptInterface::StringifyJSON(jsval obj, bool indent)
Stringifier str;
if (!JS_Stringify(m->m_cx, &obj, NULL, indent ? INT_TO_JSVAL(2) : JSVAL_VOID, &Stringifier::callback, &str))
{
JS_ClearPendingException(m->m_cx);
LOGERROR(L"StringifyJSON failed");
return "";
}