[gjs: 2/2] Merge branch '386-arg-cache-not-supported' into 'master'




commit cbd2c56fa71d68561a368a936abd7e793e6890b3
Merge: 46f09493 c641ca87
Author: Philip Chimento <philip chimento gmail com>
Date:   Tue May 4 04:57:43 2021 +0000

    Merge branch '386-arg-cache-not-supported' into 'master'
    
    arg-cache: Never throw when building the argument cache
    
    Closes #386
    
    See merge request GNOME/gjs!590

 gi/arg-cache.cpp                        | 190 +++++++++++++++-----------------
 gi/arg-cache.h                          |  24 +++-
 gi/function.cpp                         |  16 +--
 gi/function.h                           |  13 +++
 installed-tests/js/testGIMarshalling.js |   4 +-
 installed-tests/js/testIntrospection.js |   2 +
 installed-tests/js/testRegress.js       |   8 ++
 7 files changed, 138 insertions(+), 119 deletions(-)
---
diff --cc gi/arg-cache.cpp
index 5ad5bd33,2473b1ee..8889e798
--- a/gi/arg-cache.cpp
+++ b/gi/arg-cache.cpp
@@@ -1258,11 -1265,10 +1262,11 @@@ void gjs_arg_cache_build_return(GjsArgu
  
      g_callable_info_load_return_type(callable, &self->type_info);
  
 -    if (g_type_info_get_tag(&self->type_info) == GI_TYPE_TAG_VOID) {
 +    if (g_type_info_get_tag(&self->type_info) == GI_TYPE_TAG_VOID &&
 +        !g_type_info_is_pointer(&self->type_info)) {
          *inc_counter_out = false;
          gjs_arg_cache_set_skip_all(self);
-         return true;
+         return;
      }
  
      *inc_counter_out = true;
diff --cc gi/arg-cache.h
index 6422129d,b01c1add..562dcd3d
--- a/gi/arg-cache.h
+++ b/gi/arg-cache.h
@@@ -21,9 -21,21 +21,21 @@@
  #include "gjs/enum-utils.h"
  #include "gjs/macros.h"
  
 -struct GjsFunctionCallState;
 +class GjsFunctionCallState;
  struct GjsArgumentCache;
  
+ enum NotIntrospectableReason : uint8_t {
+     CALLBACK_OUT,
+     DESTROY_NOTIFY_NO_CALLBACK,
+     DESTROY_NOTIFY_NO_USER_DATA,
+     INTERFACE_TRANSFER_CONTAINER,
+     OUT_CALLER_ALLOCATES_NON_STRUCT,
+     UNREGISTERED_BOXED_WITH_TRANSFER,
+     UNREGISTERED_UNION,
+     UNSUPPORTED_TYPE,
+     LAST_REASON
+ };
+ 
  struct GjsArgumentMarshallers {
      bool (*in)(JSContext* cx, GjsArgumentCache* cache,
                 GjsFunctionCallState* state, GIArgument* in_argument,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]