Skip to content

Commit fe0f17f

Browse files
committed
[js] Make nqp::islist work properly on VMArray objects.
1 parent 26c952f commit fe0f17f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/vm/js/Operations.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ class QAST::OperationsJS {
845845

846846
add_simple_op('elems', $T_INT, [$T_OBJ]);
847847

848-
add_simple_op('islist', $T_BOOL, [$T_OBJ], sub ($obj) {"($obj instanceof nqp.NQPArray)"}, :decont(0));
848+
add_simple_op('islist', $T_INT, [$T_OBJ], :decont(0));
849849

850850

851851

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,3 +1068,7 @@ op.getlexref_n = function(hllName, get, set) {
10681068
op.fc = function(string) {
10691069
return string.toLowerCase();
10701070
};
1071+
1072+
op.islist = function(list) {
1073+
return (list instanceof NQPArray || list._STable && list._STable.REPR instanceof reprs.VMArray) ? 1 : 0;
1074+
};

0 commit comments

Comments
 (0)