| 2983 | } |
| 2984 | |
| 2985 | bool gjs_value_from_byte_array_gi_argument(JSContext* cx, |
| 2986 | JS::MutableHandleValue value_out, |
| 2987 | GIArgument* arg) { |
| 2988 | gjs_debug_marshal(GJS_DEBUG_GFUNCTION, |
| 2989 | "Converting GIArgument byte array to JS::Value"); |
| 2990 | |
| 2991 | auto* byte_array = gjs_arg_get<GByteArray*>(arg); |
| 2992 | if (!byte_array) { |
| 2993 | value_out.setNull(); |
| 2994 | return true; |
| 2995 | } |
| 2996 | |
| 2997 | JSObject* u8array = gjs_byte_array_from_byte_array(cx, byte_array); |
| 2998 | if (!u8array) |
| 2999 | return false; |
| 3000 | |
| 3001 | value_out.setObject(*u8array); |
| 3002 | return true; |
| 3003 | } |
| 3004 | |
| 3005 | bool gjs_value_from_basic_garray_gi_argument(JSContext* cx, |
| 3006 | JS::MutableHandleValue value_out, |
no test coverage detected