forked from mirrors/0ad
Add basic replay recorder/player to help debugging and performance testing.
This was SVN commit r7863.
This commit is contained in:
@@ -669,10 +669,10 @@ struct Stringifier
|
||||
std::stringstream stream;
|
||||
};
|
||||
|
||||
std::string ScriptInterface::StringifyJSON(jsval obj)
|
||||
std::string ScriptInterface::StringifyJSON(jsval obj, bool indent)
|
||||
{
|
||||
Stringifier str;
|
||||
if (!JS_Stringify(m->m_cx, &obj, NULL, INT_TO_JSVAL(2), &Stringifier::callback, &str))
|
||||
if (!JS_Stringify(m->m_cx, &obj, NULL, indent ? INT_TO_JSVAL(2) : JSVAL_VOID, &Stringifier::callback, &str))
|
||||
{
|
||||
LOGERROR(L"StringifyJSON failed");
|
||||
return "";
|
||||
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
/**
|
||||
* Stringify to a JSON string, UTF-8 encoded. Returns an empty string on error.
|
||||
*/
|
||||
std::string StringifyJSON(jsval obj);
|
||||
std::string StringifyJSON(jsval obj, bool indent = true);
|
||||
|
||||
/**
|
||||
* Report the given error message through the JS error reporting mechanism,
|
||||
|
||||
Reference in New Issue
Block a user