summaryrefslogtreecommitdiff
path: root/gi/fundamental.h
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2020-04-30 21:15:22 -0700
committerPhilip Chimento <philip.chimento@gmail.com>2020-05-16 09:54:59 -0700
commitfb7d87125e4f427f87014e6255b029acb2420100 (patch)
tree56828e13e46f6c6d596fbdfbd949d782e4d022ec /gi/fundamental.h
parent265c11cf74a715fcd2b686bd770adc982bddf443 (diff)
downloadgjs-fb7d87125e4f427f87014e6255b029acb2420100.tar.gz
function: Use JS::CallArgs throughout invocation call chain
If you have a JSObject for the 'this' object, a JS::Value array for the arguments, and a mutable JS::Value for the return value, then that's basically a JS::CallArgs. The only difference is that when calling a constructor, you may not be able to get the 'this' object from args.computeThis(). For gjs_invoke_constructor_from_c(), we need to provide the 'this' object that was provided to the constructor.
Diffstat (limited to 'gi/fundamental.h')
-rw-r--r--gi/fundamental.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/gi/fundamental.h b/gi/fundamental.h
index a1a9f363..a26461eb 100644
--- a/gi/fundamental.h
+++ b/gi/fundamental.h
@@ -30,8 +30,6 @@
#include <girepository.h>
#include <glib-object.h>
-#include <js/Id.h>
-#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include "gi/wrapperutils.h"
@@ -40,10 +38,7 @@
class FundamentalPrototype;
class FundamentalInstance;
-namespace JS {
-class CallArgs;
-class HandleValueArray;
-} // namespace JS
+namespace JS { class CallArgs; }
/* To conserve memory, we have two different kinds of private data for JS
* wrappers for fundamental types: FundamentalInstance, and
@@ -158,8 +153,7 @@ class FundamentalInstance
GJS_JSAPI_RETURN_CONVENTION
bool invoke_constructor(JSContext* cx, JS::HandleObject obj,
- const JS::HandleValueArray& args,
- GIArgument* rvalue);
+ const JS::CallArgs& args, GIArgument* rvalue);
void ref(void) { get_prototype()->call_ref_function(m_ptr); }
void unref(void) { get_prototype()->call_unref_function(m_ptr); }