From e7248c8b8b1f7774f4ac0949bb558beefe7b5207 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Mon, 1 Dec 2008 20:51:40 +0000 Subject: [PATCH] Fix Option.validateCompleter --- content/options.js | 4 ++-- content/template.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/content/options.js b/content/options.js index 06c180b0..e376c16e 100644 --- a/content/options.js +++ b/content/options.js @@ -286,9 +286,9 @@ Option.prototype = { Option.validateCompleter = function (values) { let context = CompletionContext(""); - let res = this.completer(context); + let res = context.fork("", 0, this, this.completer); if (!res) - res = context.allItems.map(function (item) [item.text]); + res = context.allItems.items.map(function (item) [item.text]); return Array.concat(values).every( function (value) res.some(function (item) item[0] == value)); }; //}}} diff --git a/content/template.js b/content/template.js index 9b339b91..788fc096 100644 --- a/content/template.js +++ b/content/template.js @@ -172,11 +172,12 @@ const template = { let n = 0; for (let [i, length] in iter) { - if (n++ > 8) + if (n++ > 50) // Prevent infinite loops. return s + <>{str.substr(start)}; XML.ignoreWhitespace = false; s += <>{str.substring(start, i)}; s += highlight(str.substr(i, length)); + liberator.dump(s); start = i + length; } return s + <>{str.substr(start)};