mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-13 23:16:12 +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) 2015 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
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
TS_ASSERT_EQUALS(4, nbr);
|
||||
|
||||
// CallFunction const JS::RootedValue& parameter overload
|
||||
script.CallFunction(val, "add", nbrVal, nbr);
|
||||
script.CallFunction(val, "add", nbr, nbrVal);
|
||||
TS_ASSERT_EQUALS(7, nbr);
|
||||
|
||||
// GetProperty JS::RootedValue* overload
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
TS_ASSERT_EQUALS(4, nbr);
|
||||
|
||||
// CallFunction const JS::HandleValue& parameter overload
|
||||
script.CallFunction(val, "add", nbrVal, nbr);
|
||||
script.CallFunction(val, "add", nbr, nbrVal);
|
||||
TS_ASSERT_EQUALS(7, nbr);
|
||||
|
||||
// GetProperty JS::MutableHandleValue overload
|
||||
|
||||
Reference in New Issue
Block a user