Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #221 from vendethiel/js-fix59
Add nqp::list_s and nqp::push_s, re-enable test 59
  • Loading branch information
pmurias committed Feb 14, 2015
2 parents 6820384 + 5ca166f commit 2eb3dc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/vm/js/QAST/Compiler.nqp
Expand Up @@ -525,7 +525,7 @@ class QAST::OperationsJS {
$comp.bind_key($node[0], $node[1], $node[2]);
});

for ['_i', $T_INT, '', $T_OBJ] -> $suffix, $type {
for ['_i', $T_INT, '', $T_OBJ, '_s', $T_STR] -> $suffix, $type {
add_op('list' ~ $suffix, sub ($comp, $node, :$want) {
my @setup;
my @exprs;
Expand Down Expand Up @@ -648,7 +648,7 @@ class QAST::OperationsJS {

add_simple_op('islist', $T_BOOL, [$T_OBJ], sub ($obj) {"($obj instanceof Array)"});

for ['_i', $T_INT, '', $T_OBJ] -> $suffix, $type {
for ['_i', $T_INT, '', $T_OBJ, '_s', $T_STR] -> $suffix, $type {
add_simple_op('atpos' ~ $suffix, $type, [$T_OBJ, $T_INT], sub ($array, $index) {"$array[$index]"});
add_simple_op('pop' ~ $suffix, $type, [$T_OBJ], sub ($array) {"$array.pop()"}, :sideffects);
add_simple_op('push' ~ $suffix, $type, [$T_OBJ, $type], sub ($array, $elem) {"$array.push($elem)"}, :sideffects);
Expand Down
2 changes: 1 addition & 1 deletion src/vm/js/bin/run_tests
@@ -1,3 +1,3 @@
#!/bin/bash
# 19 and 30 where moved out as they were parrot specific, 52,54 is missing, we can't pass 49 till we are bootstraped
prove "$@" -e './nqp-js' t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,55,56,57,58,63,64,65,68,69,70,71,75,76,81,83,88,89,90,91,92,93}* t/js/getcomp-js.t t/qast/02*
prove "$@" -e './nqp-js' t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,55,56,57,58,59,63,64,65,68,69,70,71,75,76,81,83,88,89,90,91,92,93}* t/js/getcomp-js.t t/qast/02*

0 comments on commit 2eb3dc1

Please sign in to comment.