mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Changes ToJSVal to take JS::MutableHandleValue instead of JS::Value&.
JS::MutableHandleValue is similar to JS::HandleValue, but the whole JS::Value it points to can be replaced. This change is needed for support of exact stack rooting and moving GC. Contains a few other trivial API adjustments and style improvements too. Refs #2462 Refs #2415 This was SVN commit r15534.
This commit is contained in:
+5
-2
@@ -177,6 +177,9 @@ static InReaction MainInputHandler(const SDL_Event_* ev)
|
||||
// dispatch all pending events to the various receivers.
|
||||
static void PumpEvents()
|
||||
{
|
||||
JSContext* cx = g_GUI->GetScriptInterface()->GetContext();
|
||||
JSAutoRequest rq(cx);
|
||||
|
||||
PROFILE3("dispatch events");
|
||||
|
||||
SDL_Event_ ev;
|
||||
@@ -185,8 +188,8 @@ static void PumpEvents()
|
||||
PROFILE2("event");
|
||||
if (g_GUI)
|
||||
{
|
||||
JS::Value tmpVal;
|
||||
ScriptInterface::ToJSVal(g_GUI->GetScriptInterface()->GetContext(), tmpVal, ev);
|
||||
JS::RootedValue tmpVal(cx);
|
||||
ScriptInterface::ToJSVal(cx, &tmpVal, ev);
|
||||
std::string data = g_GUI->GetScriptInterface()->StringifyJSON(tmpVal);
|
||||
PROFILE2_ATTR("%s", data.c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user