Skip to content

Commit

Permalink
[js] Add missing file.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Apr 29, 2016
1 parent cf606ff commit f16c03d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/vm/js/Perl6/Ops.nqp
@@ -0,0 +1,23 @@
my $ops := nqp::getcomp('QAST').operations;

sub register_op_desugar($op, $desugar) is export {
nqp::getcomp('QAST').operations.add_op($op, sub ($comp, $node, :$want, :$cps) {
$comp.as_js($desugar($op), :$want, :$cps);
});
}

# Stub
register_op_desugar('p6setbinder', -> $qast {
QAST::Op.new(:op('null'));
});

register_op_desugar('p6init', -> $qast {
QAST::Op.new(:op('null'));
});

$ops.add_simple_op('p6bindattrinvres', $ops.OBJ, [$ops.OBJ, $ops.OBJ, $ops.STR, $ops.OBJ], :sideffects,
sub ($obj, $type, $attr, $value) {
# TODO take second argument into account
"($obj[$attr] = $value, $obj)";
}
);

0 comments on commit f16c03d

Please sign in to comment.