From de3d43292ed37ff56fdb820b1aec7fa789247695 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 29 Sep 2010 11:46:02 -0400 Subject: [PATCH] Fix io.source heredoc parsing in FF36. Closes issue #32. --- common/content/io.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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); };