Skip to content

Commit

Permalink
[js] Implement nqp::p6staticouter
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Aug 27, 2017
1 parent cfb70b3 commit b0135ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vm/js/Perl6/Ops.nqp
Expand Up @@ -131,3 +131,5 @@ $ops.add_simple_op('p6takefirstflag', $ops.INT, [], :ctx, :side_effects);
$ops.add_simple_op('p6setpre', $ops.OBJ, [], :ctx, :side_effects);
$ops.add_simple_op('p6clearpre', $ops.OBJ, [], :ctx, :side_effects);
$ops.add_simple_op('p6inpre', $ops.INT, [], :ctx, :side_effects);

$ops.add_simple_op('p6staticouter', $ops.OBJ, [$ops.OBJ], :ctx, :side_effects);
5 changes: 5 additions & 0 deletions src/vm/js/perl6-runtime/runtime.js
Expand Up @@ -307,6 +307,11 @@ module.exports.load = function(nqp, CodeRef, Capture, containerSpecs) {
}
};

op.p6staticouter = function(ctx, codeRef) {
if (!(codeRef instanceof CodeRef)) throw new nqp.NQPException("p6staticouter must be used on a CodeRef");
return codeRef.staticCode.outerCodeRef;
};

function RakudoScalar(STable) {
this.STable = STable;
}
Expand Down

0 comments on commit b0135ef

Please sign in to comment.