Skip to content

Commit 2bee5e6

Browse files
committed
[js] Fix nqp::istype_nd
1 parent ec8d715 commit 2bee5e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vm/js/Operations.nqp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ class QAST::OperationsJS {
7676
}
7777
}
7878

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) {
8080

8181
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));
8383
my $chunk := op_template($comp, $node, $return_type, @argument_types, $gen_code, :$ctx, :$decont, :$method_call, :$takes_hll, :$await);
8484
$side_effects ?? $comp.stored_result($chunk, :$want) !! $chunk;
8585
}, :$inlinable, :$hll);
@@ -870,7 +870,7 @@ class QAST::OperationsJS {
870870
add_simple_op('can', $T_INT, [$T_OBJ, $T_STR], :side_effects, :decont(0), :ctx, :method_call, :await);
871871

872872
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);
874874

875875
add_simple_op('split', $T_OBJ, [$T_STR, $T_STR], :takes_hll);
876876

0 commit comments

Comments
 (0)