diff --git a/common/content/io.js b/common/content/io.js index fc9aa35e..c069105a 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -362,11 +362,15 @@ lookup: this.readHeredoc = function (end) { let res = []; - for (let [i, line] in iter) - if (line === end) - return res.join("\n"); - else - res.push(line); + try { + while (true) + let ([i, line] = iter.next()) { + if (line === end) + return res.join("\n"); + res.push(line); + } + } + catch (e if e instanceof StopIteration) {} dactyl.assert(false, "Unexpected end of file waiting for " + end); };