@@ -244,11 +244,27 @@ bool rb_js_abi_host_reflect_delete_property(rb_js_abi_host_js_abi_value_t target
244244 int32_t ret = __wasm_import_rb_js_abi_host_reflect_delete_property ((target ).idx , (int32_t ) (* property_key ).ptr , (int32_t ) (* property_key ).len );
245245 return ret ;
246246}
247- __attribute__((import_module ("rb-js-abi-host" ), import_name ("reflect-get: func(target: handle<js-abi-value>, property-key: string) -> handle<js-abi-value>" )))
248- int32_t __wasm_import_rb_js_abi_host_reflect_get (int32_t , int32_t , int32_t );
249- rb_js_abi_host_js_abi_value_t rb_js_abi_host_reflect_get (rb_js_abi_host_js_abi_value_t target , rb_js_abi_host_string_t * property_key ) {
250- int32_t ret = __wasm_import_rb_js_abi_host_reflect_get ((target ).idx , (int32_t ) (* property_key ).ptr , (int32_t ) (* property_key ).len );
251- return (rb_js_abi_host_js_abi_value_t ){ ret };
247+ __attribute__((import_module ("rb-js-abi-host" ), import_name ("reflect-get: func(target: handle<js-abi-value>, property-key: string) -> variant { success(handle<js-abi-value>), failure(handle<js-abi-value>) }" )))
248+ void __wasm_import_rb_js_abi_host_reflect_get (int32_t , int32_t , int32_t , int32_t );
249+ void rb_js_abi_host_reflect_get (rb_js_abi_host_js_abi_value_t target , rb_js_abi_host_string_t * property_key , rb_js_abi_host_js_abi_result_t * ret0 ) {
250+
251+ __attribute__((aligned (4 )))
252+ uint8_t ret_area [8 ];
253+ int32_t ptr = (int32_t ) & ret_area ;
254+ __wasm_import_rb_js_abi_host_reflect_get ((target ).idx , (int32_t ) (* property_key ).ptr , (int32_t ) (* property_key ).len , ptr );
255+ rb_js_abi_host_js_abi_result_t variant ;
256+ variant .tag = (int32_t ) (* ((uint8_t * ) (ptr + 0 )));
257+ switch ((int32_t ) variant .tag ) {
258+ case 0 : {
259+ variant .val .success = (rb_js_abi_host_js_abi_value_t ){ * ((int32_t * ) (ptr + 4 )) };
260+ break ;
261+ }
262+ case 1 : {
263+ variant .val .failure = (rb_js_abi_host_js_abi_value_t ){ * ((int32_t * ) (ptr + 4 )) };
264+ break ;
265+ }
266+ }
267+ * ret0 = variant ;
252268}
253269__attribute__((import_module ("rb-js-abi-host" ), import_name ("reflect-get-own-property-descriptor: func(target: handle<js-abi-value>, property-key: string) -> handle<js-abi-value>" )))
254270int32_t __wasm_import_rb_js_abi_host_reflect_get_own_property_descriptor (int32_t , int32_t , int32_t );
@@ -290,11 +306,27 @@ bool rb_js_abi_host_reflect_prevent_extensions(rb_js_abi_host_js_abi_value_t tar
290306 int32_t ret = __wasm_import_rb_js_abi_host_reflect_prevent_extensions ((target ).idx );
291307 return ret ;
292308}
293- __attribute__((import_module ("rb-js-abi-host" ), import_name ("reflect-set: func(target: handle<js-abi-value>, property-key: string, value: handle<js-abi-value>) -> bool" )))
294- int32_t __wasm_import_rb_js_abi_host_reflect_set (int32_t , int32_t , int32_t , int32_t );
295- bool rb_js_abi_host_reflect_set (rb_js_abi_host_js_abi_value_t target , rb_js_abi_host_string_t * property_key , rb_js_abi_host_js_abi_value_t value ) {
296- int32_t ret = __wasm_import_rb_js_abi_host_reflect_set ((target ).idx , (int32_t ) (* property_key ).ptr , (int32_t ) (* property_key ).len , (value ).idx );
297- return ret ;
309+ __attribute__((import_module ("rb-js-abi-host" ), import_name ("reflect-set: func(target: handle<js-abi-value>, property-key: string, value: handle<js-abi-value>) -> variant { success(handle<js-abi-value>), failure(handle<js-abi-value>) }" )))
310+ void __wasm_import_rb_js_abi_host_reflect_set (int32_t , int32_t , int32_t , int32_t , int32_t );
311+ void rb_js_abi_host_reflect_set (rb_js_abi_host_js_abi_value_t target , rb_js_abi_host_string_t * property_key , rb_js_abi_host_js_abi_value_t value , rb_js_abi_host_js_abi_result_t * ret0 ) {
312+
313+ __attribute__((aligned (4 )))
314+ uint8_t ret_area [8 ];
315+ int32_t ptr = (int32_t ) & ret_area ;
316+ __wasm_import_rb_js_abi_host_reflect_set ((target ).idx , (int32_t ) (* property_key ).ptr , (int32_t ) (* property_key ).len , (value ).idx , ptr );
317+ rb_js_abi_host_js_abi_result_t variant ;
318+ variant .tag = (int32_t ) (* ((uint8_t * ) (ptr + 0 )));
319+ switch ((int32_t ) variant .tag ) {
320+ case 0 : {
321+ variant .val .success = (rb_js_abi_host_js_abi_value_t ){ * ((int32_t * ) (ptr + 4 )) };
322+ break ;
323+ }
324+ case 1 : {
325+ variant .val .failure = (rb_js_abi_host_js_abi_value_t ){ * ((int32_t * ) (ptr + 4 )) };
326+ break ;
327+ }
328+ }
329+ * ret0 = variant ;
298330}
299331__attribute__((import_module ("rb-js-abi-host" ), import_name ("reflect-set-prototype-of: func(target: handle<js-abi-value>, prototype: handle<js-abi-value>) -> bool" )))
300332int32_t __wasm_import_rb_js_abi_host_reflect_set_prototype_of (int32_t , int32_t );
0 commit comments