Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Refactor the 'call' op handling some more.
  • Loading branch information
pmurias committed Sep 17, 2014
1 parent 20af910 commit 2f1995e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/vm/js/QAST/Compiler.nqp
Expand Up @@ -414,13 +414,14 @@ class QAST::OperationsJS {

my $call;
if nqp::islist($compiled_args) {
my $merged_args := merge_arg_groups($compiled_args);
$comp.stored_result(
Chunk.new($T_OBJ, "{$callee.expr}.apply(undefined,{$merged_args.expr})" , [$callee, $merged_args], :$node), :$want);
$compiled_args := merge_arg_groups($compiled_args);
$call := '.apply(undefined,';
} else {
$comp.stored_result(
Chunk.new($T_OBJ, "{$callee.expr}({$compiled_args.expr})" , [$callee, $compiled_args], :$node), :$want);
$call := '(';
}

$comp.stored_result(
Chunk.new($T_OBJ, $callee.expr ~ $call ~ $compiled_args.expr ~ ')' , [$callee, $compiled_args], :$node), :$want);
});

add_simple_op('split', $T_OBJ, [$T_STR, $T_STR], sub ($separator, $string) {
Expand Down

0 comments on commit 2f1995e

Please sign in to comment.