@@ -21,17 +21,47 @@ typedef ext_string_t rb_abi_guest_string_t;
21
21
typedef ext_string_t rb_js_abi_host_string_t ;
22
22
typedef ext_list_string_t rb_abi_guest_list_string_t ;
23
23
24
+ # define borrow_js_value (v ) ruby_js_js_runtime_borrow_js_abi_value(v)
25
+
24
26
# define rb_abi_guest_rb_abi_value_new (val ) exports_ruby_js_ruby_runtime_rb_abi_value_new(val)
25
27
# define rb_abi_guest_rb_abi_value_get (val ) (*(val))
26
28
# define rb_abi_guest_rb_iseq_new (val ) exports_ruby_js_ruby_runtime_rb_iseq_new(val)
27
- # define rb_js_abi_host_js_value_equal (lhs , rhs ) ruby_js_js_runtime_js_value_equal(lhs, rhs)
28
- # define rb_js_abi_host_reflect_apply (target , this , args , ret ) ruby_js_js_runtime_reflect_apply(target, this, args, ret)
29
- # define rb_js_abi_host_js_value_to_integer (value , ret ) ruby_js_js_runtime_js_value_to_integer(value, ret)
29
+ # define rb_js_abi_host_js_value_equal (lhs , rhs ) ruby_js_js_runtime_js_value_equal(borrow_js_value(lhs), borrow_js_value(rhs))
30
+ # define rb_js_abi_host_reflect_apply (target , this , args , ret ) ruby_js_js_runtime_reflect_apply(borrow_js_value(target), borrow_js_value(this), args, ret)
31
+ # define rb_js_abi_host_js_value_to_integer (value , ret ) ruby_js_js_runtime_js_value_to_integer(borrow_js_value(value), ret)
32
+ # define rb_js_abi_host_export_js_value_to_host (value ) ruby_js_js_runtime_export_js_value_to_host(borrow_js_value(value))
33
+ # define rb_js_abi_host_raw_integer_free (ptr ) ruby_js_js_runtime_raw_integer_free(ptr)
34
+ # define rb_js_abi_host_rb_object_to_js_rb_value (val ) ruby_js_js_runtime_rb_object_to_js_rb_value(val)
35
+ # define rb_js_abi_host_int_to_js_number (val ) ruby_js_js_runtime_int_to_js_number(val)
36
+ # define rb_js_abi_host_float_to_js_number (val ) ruby_js_js_runtime_float_to_js_number(val)
37
+ # define rb_js_abi_host_string_to_js_string (val ) ruby_js_js_runtime_string_to_js_string(val)
38
+ # define rb_js_abi_host_bool_to_js_bool (val ) ruby_js_js_runtime_bool_to_js_bool(val)
39
+ # define rb_js_abi_host_proc_to_js_function (val ) ruby_js_js_runtime_proc_to_js_function(val)
40
+ # define rb_js_abi_host_import_js_value_from_host () ruby_js_js_runtime_import_js_value_from_host()
41
+ # define rb_js_abi_host_js_value_to_string (value , ret ) ruby_js_js_runtime_js_value_to_string(borrow_js_value(value), ret)
42
+ # define rb_js_abi_host_js_value_typeof (value , ret ) ruby_js_js_runtime_js_value_typeof(borrow_js_value(value), ret)
43
+ # define rb_js_abi_host_js_value_strictly_equal (lhs , rhs ) ruby_js_js_runtime_js_value_strictly_equal(borrow_js_value(lhs), borrow_js_value(rhs))
44
+ # define rb_js_abi_host_reflect_get (target , key , ret ) ruby_js_js_runtime_reflect_get(borrow_js_value(target), key, ret)
45
+ # define rb_js_abi_host_reflect_set (target , key , value , ret ) ruby_js_js_runtime_reflect_set(borrow_js_value(target), key, borrow_js_value(value), ret)
46
+ # define rb_js_abi_host_global_this () ruby_js_js_runtime_global_this()
47
+ # define rb_js_abi_host_instance_of (value , klass ) ruby_js_js_runtime_instance_of(borrow_js_value(value), borrow_js_value(klass))
48
+ # define rb_js_abi_host_is_js (value ) ruby_js_js_runtime_is_js(borrow_js_value(value))
49
+ # define rb_js_abi_host_eval_js (code , ret ) ruby_js_js_runtime_eval_js(code, ret)
50
+
51
+ # define rb_js_abi_host_js_abi_value_free (ptr ) ruby_js_js_runtime_js_abi_value_drop_own(*ptr)
52
+
53
+ # define RB_JS_ABI_HOST_RAW_INTEGER_AS_FLOAT RUBY_JS_JS_RUNTIME_RAW_INTEGER_AS_FLOAT
54
+ # define RB_JS_ABI_HOST_JS_ABI_RESULT_FAILURE RUBY_JS_JS_RUNTIME_JS_ABI_RESULT_FAILURE
55
+
30
56
#else
31
57
# include "bindgen/legacy/rb-abi-guest.h"
32
58
# include "bindgen/legacy/rb-js-abi-host.h"
33
59
typedef rb_abi_guest_rb_abi_value_t rb_abi_guest_own_rb_abi_value_t ;
34
60
typedef rb_js_abi_host_js_abi_value_t rb_js_abi_host_own_js_abi_value_t ;
61
+
62
+ # define borrow_js_value (v ) v
63
+
64
+ # define rb_js_abi_host_js_abi_value_free (ptr ) rb_js_abi_host_js_abi_value_free(ptr)
35
65
#endif
36
66
37
67
#endif // RUBY_WASM_JS_TYPES_H
0 commit comments