Skip to content

Commit

Permalink
Fix broken eachLoop, which was not properly using the activation reco…
Browse files Browse the repository at this point in the history
…rd argument -- when CPO tried to render multiple errors, this failed with a JS-level error about ar.vars not existing, which got stifled and terminated the program...
  • Loading branch information
Ben Lerner committed Apr 2, 2017
1 parent 284e22c commit b7f9c90
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/js/base/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -3108,13 +3108,10 @@ function (Namespace, jsnums, codePoint, seedrandom, util) {
function eachLoop(fun, start, stop) {
var i = start;
var started = false;
function restart(_fun) {
if(thisRuntime.isActivationRecord(_fun)) {
var ar = fun
function restart(ar) {
if(thisRuntime.isActivationRecord(ar)) {
i = ar.vars[0];
fun = ar.vars[1];
stop = ar.vars[2];
started = ar.vars[3];
started = ar.vars[1];
if (started) {
i = i + 1;
}
Expand All @@ -3140,7 +3137,7 @@ function (Namespace, jsnums, codePoint, seedrandom, util) {
var res = restart();
if(isContinuation(res)) {
res.stack[thisRuntime.EXN_STACKHEIGHT++] =
thisRuntime.makeActivationRecord("eachLoop", restart, true, [], [i, fun, stop, started]);
thisRuntime.makeActivationRecord("eachLoop", restart, true, [], [i, started]);
}
return res;
}
Expand Down

0 comments on commit b7f9c90

Please sign in to comment.