Skip to content

Commit b7f9c90

Browse files
author
Ben Lerner
committed
Fix broken eachLoop, which was not properly using the activation record 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...
1 parent 284e22c commit b7f9c90

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/js/base/runtime.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3108,13 +3108,10 @@ function (Namespace, jsnums, codePoint, seedrandom, util) {
31083108
function eachLoop(fun, start, stop) {
31093109
var i = start;
31103110
var started = false;
3111-
function restart(_fun) {
3112-
if(thisRuntime.isActivationRecord(_fun)) {
3113-
var ar = fun
3111+
function restart(ar) {
3112+
if(thisRuntime.isActivationRecord(ar)) {
31143113
i = ar.vars[0];
3115-
fun = ar.vars[1];
3116-
stop = ar.vars[2];
3117-
started = ar.vars[3];
3114+
started = ar.vars[1];
31183115
if (started) {
31193116
i = i + 1;
31203117
}
@@ -3140,7 +3137,7 @@ function (Namespace, jsnums, codePoint, seedrandom, util) {
31403137
var res = restart();
31413138
if(isContinuation(res)) {
31423139
res.stack[thisRuntime.EXN_STACKHEIGHT++] =
3143-
thisRuntime.makeActivationRecord("eachLoop", restart, true, [], [i, fun, stop, started]);
3140+
thisRuntime.makeActivationRecord("eachLoop", restart, true, [], [i, started]);
31443141
}
31453142
return res;
31463143
}

0 commit comments

Comments
 (0)