mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-14 14:15:09 +00:00
Exact stack rooting for ScriptInterface::ToString.
I had to change a few other functions to take JS::MutableHandleValue because JS::Stringify takes a JS::MutableHandleValue as input parameter. That seems a bit strange because it should not change that value. I assume it has historical reasons. Refs #2415 Refs #2462 This was SVN commit r15605.
This commit is contained in:
@@ -265,7 +265,8 @@ public:
|
||||
template<typename CHAR> bool Eval(const CHAR* code, JS::MutableHandleValue out);
|
||||
template<typename T, typename CHAR> bool Eval(const CHAR* code, T& out);
|
||||
|
||||
std::wstring ToString(jsval obj, bool pretty = false);
|
||||
// We have to use a mutable handle because JS_Stringify requires that for unknown reasons.
|
||||
std::wstring ToString(JS::MutableHandleValue obj, bool pretty = false);
|
||||
|
||||
/**
|
||||
* Parse a UTF-8-encoded JSON string. Returns the unmodified value on error and prints an error message.
|
||||
|
||||
Reference in New Issue
Block a user