mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-25 14:08:59 +00:00
Fix missing JSAutoRequest before JS_ReportError in various commits.
Differential Revision: https://code.wildfiregames.com/D2256 Tested on: clang 8.0.1, Jenkins This was SVN commit r22949.
This commit is contained in:
@@ -90,10 +90,11 @@ template<> void ScriptInterface::ToJSVal<const CParamNode*>(JSContext* cx, JS::M
|
||||
|
||||
template<> bool ScriptInterface::FromJSVal<CColor>(JSContext* cx, JS::HandleValue v, CColor& out)
|
||||
{
|
||||
JSAutoRequest rq(cx);
|
||||
|
||||
if (!v.isObject())
|
||||
FAIL("JS::HandleValue not an object");
|
||||
|
||||
JSAutoRequest rq(cx);
|
||||
JS::RootedObject obj(cx, &v.toObject());
|
||||
|
||||
JS::RootedValue r(cx);
|
||||
@@ -262,10 +263,11 @@ template<> void ScriptInterface::ToJSVal<Grid<u16> >(JSContext* cx, JS::MutableH
|
||||
|
||||
template<> bool ScriptInterface::FromJSVal<TNSpline>(JSContext* cx, JS::HandleValue v, TNSpline& out)
|
||||
{
|
||||
JSAutoRequest rq(cx);
|
||||
|
||||
if (!v.isObject())
|
||||
FAIL("Argument must be an object");
|
||||
|
||||
JSAutoRequest rq(cx);
|
||||
JS::RootedObject obj(cx, &v.toObject());
|
||||
bool isArray;
|
||||
if (!JS_IsArrayObject(cx, obj, &isArray) || !isArray)
|
||||
@@ -300,10 +302,11 @@ template<> bool ScriptInterface::FromJSVal<TNSpline>(JSContext* cx, JS::HandleVa
|
||||
|
||||
template<> bool ScriptInterface::FromJSVal<CCinemaPath>(JSContext* cx, JS::HandleValue v, CCinemaPath& out)
|
||||
{
|
||||
JSAutoRequest rq(cx);
|
||||
|
||||
if (!v.isObject())
|
||||
FAIL("Argument must be an object");
|
||||
|
||||
JSAutoRequest rq(cx);
|
||||
JS::RootedObject obj(cx, &v.toObject());
|
||||
|
||||
CCinemaData pathData;
|
||||
|
||||
Reference in New Issue
Block a user