Skip to content

Commit d38f177

Browse files
committed
Implement nqp::findmethod.
1 parent 232b9cf commit d38f177

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/vm/js/QAST/Compiler.nqp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,9 @@ class QAST::OperationsJS {
627627

628628
});
629629

630+
631+
add_simple_op('findmethod', $T_OBJ, [$T_OBJ, $T_STR], :sideffects);
632+
630633
add_simple_op('split', $T_OBJ, [$T_STR, $T_STR], sub ($separator, $string) {
631634
"({$string} == '' ? [] : {$string}.split({$separator}))"
632635
});

src/vm/js/bin/run_tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
# 19 and 30 where moved out as they were parrot specific, 52,54 is missing, we can't pass 49 till we are bootstraped
3-
prove -e './nqp-js' t/nqp/{01..18}* t/nqp/{20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,56,57,58,59,63,64,65,68,69,70,71,75,76,81,83,88}* t/js/getcomp-js.t t/qast/02*
3+
prove -e './nqp-js' t/nqp/{01..18}* t/nqp/{20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,56,57,58,59,63,64,65,68,69,70,71,75,76,81,83,88,90}* t/js/getcomp-js.t t/qast/02*

src/vm/js/nqp-runtime/core.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,7 @@ op.splice = function(target, source, offset, length) {
229229
target.splice.apply(target, args);
230230
return target;
231231
}
232+
233+
op.findmethod = function(obj, method) {
234+
return obj._STable._method_cache[method];
235+
};

0 commit comments

Comments
 (0)