mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 22:24:19 +00:00
Employ some variadic macros to make some of the C++ -> JS function calling code nicer.
Template-ize CallFunctionVoid. Changes CallFunction parameter order to make template parameter deduction with variadic parameters work nicely. Reviewed By: Itms, wraitii, Yves Differential Revision: https://code.wildfiregames.com/D77 This was SVN commit r19183.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2016 Wildfire Games.
|
||||
/* Copyright (C) 2017 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -562,14 +562,6 @@ JSObject* ScriptInterface::CreateCustomObject(const std::string& typeName) const
|
||||
return JS_NewObjectWithGivenProto(m->m_cx, it->second.m_Class, prototype);
|
||||
}
|
||||
|
||||
bool ScriptInterface::CallFunctionVoid(JS::HandleValue val, const char* name)
|
||||
{
|
||||
JSAutoRequest rq(m->m_cx);
|
||||
JS::RootedValue jsRet(m->m_cx);
|
||||
return CallFunction_(val, name, JS::HandleValueArray::empty(), &jsRet);
|
||||
}
|
||||
|
||||
|
||||
bool ScriptInterface::CallFunction_(JS::HandleValue val, const char* name, JS::HandleValueArray argv, JS::MutableHandleValue ret) const
|
||||
{
|
||||
JSAutoRequest rq(m->m_cx);
|
||||
|
||||
Reference in New Issue
Block a user