@@ -76,10 +76,10 @@ class QAST::OperationsJS {
76
76
}
77
77
}
78
78
79
- sub add_simple_op ($ op , $ return_type , @ argument_types , $ cb = runtime_op( $ op ) , : $ side_effects , : $ ctx , : $ inlinable = 1 , : $ decont , : $ method_call , : $ takes_hll , : $ hll , : $ await ) {
79
+ sub add_simple_op ($ op , $ return_type , @ argument_types , $ cb ? , : $ side_effects , : $ ctx , : $ inlinable = 1 , : $ decont , : $ method_call , : $ takes_hll , : $ hll , : $ await ) {
80
80
81
81
add_op($ op , sub ($ comp , $ node , : $ want ) {
82
- my $ gen_code := $ method_call ?? method_call($ op ) !! $ cb ;
82
+ my $ gen_code := $ cb ?? $ cb !! ( $ method_call ?? method_call($ op ) !! runtime_op( $ op )) ;
83
83
my $ chunk := op_template($ comp , $ node , $ return_type , @ argument_types , $ gen_code , : $ ctx , : $ decont , : $ method_call , : $ takes_hll , : $ await );
84
84
$ side_effects ?? $ comp . stored_result($ chunk , : $ want ) !! $ chunk ;
85
85
}, : $ inlinable , : $ hll );
@@ -870,7 +870,7 @@ class QAST::OperationsJS {
870
870
add_simple_op(' can' , $ T_INT , [$ T_OBJ , $ T_STR ], : side_effects, : decont(0 ), : ctx, : method_call, : await);
871
871
872
872
add_simple_op(' istype' , $ T_INT , [$ T_OBJ , $ T_OBJ ], : side_effects, : ctx, : decont(0 , 1 ), : method_call, : await);
873
- add_simple_op(' istype_nd' , $ T_INT , [$ T_OBJ , $ T_OBJ ], method_call(' istype' ), : side_effects, : ctx, : await);
873
+ add_simple_op(' istype_nd' , $ T_INT , [$ T_OBJ , $ T_OBJ ], method_call(' istype' ), : side_effects, : ctx, : await, : method_call );
874
874
875
875
add_simple_op(' split' , $ T_OBJ , [$ T_STR , $ T_STR ], : takes_hll);
876
876
0 commit comments