Skip to content

Commit

Permalink
[js] Implement nqp::tryfindmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Feb 20, 2018
1 parent 96c2411 commit 218702c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vm/js/Operations.nqp
Expand Up @@ -855,6 +855,8 @@ class QAST::OperationsJS {
add_simple_op('backtrace', $T_OBJ, [$T_OBJ], :takes_hll);

add_simple_op('findmethod', $T_OBJ, [$T_OBJ, $T_STR], :side_effects, :decont(0), :ctx);
add_simple_op('tryfindmethod', $T_OBJ, [$T_OBJ, $T_STR], :side_effects, :decont(0), :ctx);

add_simple_op('can', $T_INT, [$T_OBJ, $T_STR], :side_effects, :decont(0), :ctx, :method_call);

add_simple_op('istype', $T_INT, [$T_OBJ, $T_OBJ], :side_effects, :ctx, :decont(0, 1), :method_call);
Expand Down
4 changes: 4 additions & 0 deletions src/vm/js/nqp-runtime/core.js
Expand Up @@ -413,6 +413,10 @@ op.findmethod = function(ctx, obj, name) {
return method;
};

op.tryfindmethod = function(ctx, obj, name) {
return sixmodel.findMethod(ctx, obj, name);
};

op.getcodename = function(code) {
return code.name;
};
Expand Down

0 comments on commit 218702c

Please sign in to comment.