From 688ea844cc763fff807aad785d3322f16bf9d014 Mon Sep 17 00:00:00 2001 From: janus_wel Date: Thu, 5 Feb 2009 18:05:56 +0900 Subject: [PATCH] Allow setting empty value to some stringlist options * eventignore * activate * newtab * suggestengines * wildoptions Signed-off-by: Kris Maglione --- common/content/completion.js | 3 ++- common/content/options.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index 71c2ad7c..c7906969 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -1662,7 +1662,8 @@ function Completion() //{{{ completer = function () [["true", ""], ["false", ""]]; break; case "stringlist": - len = newValues.pop().length; + let target = newValues.pop(); + len = target ? target.length : 0; break; case "charlist": len = 0; diff --git a/common/content/options.js b/common/content/options.js index 7b5b3592..f997a697 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -80,7 +80,7 @@ Option.prototype = { parseValues: function (value) { if (this.type == "stringlist") - return value.split(","); + return (value === "") ? [] : value.split(","); if (this.type == "charlist") return Array.slice(value); return value;