Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement nqp::setelems.
  • Loading branch information
pmurias committed Feb 7, 2015
1 parent 21fee9b commit 308cb9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vm/js/QAST/Compiler.nqp
Expand Up @@ -631,6 +631,8 @@ class QAST::OperationsJS {
add_simple_op('unshift', $T_OBJ, [$T_OBJ, $T_OBJ], sub ($array, $elem) {"$array.unshift($elem)"}, :sideffects);
add_simple_op('splice', $T_OBJ, [$T_OBJ, $T_OBJ, $T_INT, $T_INT], :sideffects);

add_simple_op('setelems', $T_OBJ, [$T_OBJ, $T_INT], :sideffects, sub ($array, $elems) {"($array.length = $elems, $array)"});

add_simple_op('iterator', $T_OBJ, [$T_OBJ], :sideffects);

add_simple_op('iterval', $T_OBJ, [$T_OBJ], sub ($iter) {"$iter.iterval()"});
Expand Down

0 comments on commit 308cb9f

Please sign in to comment.