Exact stack rooting for JSON related ScriptInterface functions.

Refs #2415
Refs #2462

This was SVN commit r15603.
This commit is contained in:
Yves
2014-08-02 22:21:50 +00:00
parent 15fa9e2c2e
commit a2bd44b23a
25 changed files with 151 additions and 79 deletions
+5 -5
View File
@@ -268,19 +268,19 @@ public:
std::wstring ToString(jsval obj, bool pretty = false);
/**
* Parse a UTF-8-encoded JSON string. Returns the undefined value on error.
* Parse a UTF-8-encoded JSON string. Returns the unmodified value on error and prints an error message.
*/
CScriptValRooted ParseJSON(const std::string& string_utf8);
void ParseJSON(const std::string& string_utf8, JS::MutableHandleValue out);
/**
* Read a JSON file. Returns the undefined value on error.
* Read a JSON file. Returns the unmodified value on error and prints an error message.
*/
CScriptValRooted ReadJSONFile(const VfsPath& path);
void ReadJSONFile(const VfsPath& path, JS::MutableHandleValue out);
/**
* Stringify to a JSON string, UTF-8 encoded. Returns an empty string on error.
*/
std::string StringifyJSON(jsval obj, bool indent = true);
std::string StringifyJSON(JS::MutableHandleValue obj, bool indent = true);
/**
* Report the given error message through the JS error reporting mechanism,