diff --git a/src/vm/js/Perl6/Ops.nqp b/src/vm/js/Perl6/Ops.nqp index 705d4579f80..2d6f51ccf98 100644 --- a/src/vm/js/Perl6/Ops.nqp +++ b/src/vm/js/Perl6/Ops.nqp @@ -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); diff --git a/src/vm/js/perl6-runtime/runtime.js b/src/vm/js/perl6-runtime/runtime.js index 79adcc1be74..963ef60d3d7 100644 --- a/src/vm/js/perl6-runtime/runtime.js +++ b/src/vm/js/perl6-runtime/runtime.js @@ -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; }