Skip to content

Commit

Permalink
[js] Fix nqp::ctxcallerskipthunks
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Jun 17, 2017
1 parent f6459b6 commit 4355676
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vm/js/nqp-runtime/core.js
Expand Up @@ -999,7 +999,8 @@ op.ctxcaller = function(ctx) {
};

op.ctxcallerskipthunks = function(ctx) {
var caller = ctx.$$skipHandlers().$$caller;
let caller = ctx.$$skipHandlers().$$caller;
if (caller) caller = caller.$$skipHandlers();

// FIXME - ctxs that don't have a codeRef
while (caller && caller.codeRef().staticCode.isThunk) {
Expand All @@ -1010,11 +1011,12 @@ op.ctxcallerskipthunks = function(ctx) {
};

op.ctxouterskipthunks = function(ctx) {
var outer = ctx.$$outer;
var outer = ctx.$$skipHandlers().$$outer;

// FIXME - ctxs that don't have a codeRef
while (outer && outer.codeRef().staticCode.isThunk) {
outer = outer.$$outer;
if (outer) outer = outer.$$skipHandlers();
}
return outer || Null;
};
Expand Down

0 comments on commit 4355676

Please sign in to comment.