Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A ugly hack the way nqp::atpos_i works needed for NFA construction.
Needs a rework/rethinking of the way arrays are handled to solve properly.
  • Loading branch information
pmurias committed Sep 1, 2015
1 parent c4c285c commit 8a21e61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vm/js/QAST/Compiler.nqp
Expand Up @@ -723,9 +723,9 @@ class QAST::OperationsJS {
add_simple_op('push' ~ $suffix, $type, [$T_OBJ, $type], sub ($array, $elem) {"$array.push($elem)"}, :sideffects);
}

for ['_i', $T_INT, '_s', $T_STR] -> $suffix, $type {
add_simple_op('atpos' ~ $suffix, $type, [$T_OBJ, $T_INT], sub ($array, $index) {"$array[$index]"});
}

# HACK
add_simple_op('atpos_i', $T_INT, [$T_OBJ, $T_INT], sub ($array, $index) {"($array[$index] === undefined ? 0 : $array[$index])"});

add_op('curlexpad', sub ($comp, $node, :$want) {
my @get;
Expand Down

0 comments on commit 8a21e61

Please sign in to comment.