Skip to content

Commit

Permalink
[js] Make nqp::continuationinvoke return the correct value.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Nov 28, 2015
1 parent c0b2f4b commit 721ff06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vm/js/nqp-runtime/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,11 @@ function startTrampoline(thunk_) {
}
};

var continuationValue;
op.continuationreset = function(ctx, tag, continuation) {
startTrampoline(function() {
continuation.$callCPS(ctx, {}, function() {
console.log("we reached the end of our trampoline experience");
continuation.$callCPS(ctx, {}, function(value) {
continuationValue = value;
});
});
};
Expand All @@ -714,4 +715,5 @@ op.continuationcontrol = function(ctx, protect, tag, run, cont) {
op.continuationinvoke = function(ctx, cont, inject) {
// TODO inject
startTrampoline(cont);
return continuationValue;
};

0 comments on commit 721ff06

Please sign in to comment.