From 70022ff0af3e9ad429dace5f2ae181147477a5fc Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 28 Jan 2009 09:15:26 -0500 Subject: [PATCH] Stricter number option parsing (and comment out some dump statements) --- common/content/events.js | 10 +++++----- common/content/hints.js | 2 -- common/content/liberator.js | 1 - common/content/options.js | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/common/content/events.js b/common/content/events.js index dc5b7b5d..a8d6290c 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1120,7 +1120,7 @@ function Events() //{{{ waitForPageLoad: function () { - liberator.dump("start waiting in loaded state: " + buffer.loaded); + //liberator.dump("start waiting in loaded state: " + buffer.loaded); liberator.threadYield(true); // clear queue if (buffer.loaded == 1) @@ -1133,8 +1133,8 @@ function Events() //{{{ while (now = Date.now(), now < end) { liberator.threadYield(); - if ((now - start) % 1000 < 10) - liberator.dump("waited: " + (now - start) + " ms"); + //if ((now - start) % 1000 < 10) + // liberator.dump("waited: " + (now - start) + " ms"); if (!events.feedingKeys) return false; @@ -1153,7 +1153,7 @@ function Events() //{{{ let ret = (buffer.loaded == 1); if (!ret) liberator.echoerr("Page did not load completely in " + maxWaitTime + " seconds. Macro stopped."); - liberator.dump("done waiting: " + ret); + //liberator.dump("done waiting: " + ret); // sometimes the input widget had focus when replaying a macro // maybe this call should be moved somewhere else? @@ -1217,7 +1217,7 @@ function Events() //{{{ { if (config.isComposeWindow) { - liberator.dump("Compose editor got focus"); + //liberator.dump("Compose editor got focus"); modes.set(modes.INSERT, modes.TEXTAREA); } else if (liberator.mode != modes.MESSAGE) diff --git a/common/content/hints.js b/common/content/hints.js index b68f821c..12f0ac57 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -510,8 +510,6 @@ function Hints() //{{{ return function (linkText) { - liberator.dump(hintStrings); - if (hintStrings.length == 1 && hintStrings[0].length == 0) return true; diff --git a/common/content/liberator.js b/common/content/liberator.js index 87fcbd96..2e3e1d7c 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -1417,7 +1417,6 @@ window.liberator = liberator; // FIXME: Ugly, etc. window.addEventListener("liberatorHelpLink", function (event) { let elem = event.target; - liberator.dump(String(elem)); if (/^(option|mapping|command)$/.test(elem.className)) var tag = elem.textContent.replace(/\s.*/, ""); if (elem.className == "command") diff --git a/common/content/options.js b/common/content/options.js index 54b3bb8d..7b5b3592 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -203,9 +203,9 @@ Option.prototype = { break; case "number": - let value = parseInt(values); // deduce radix + let value = Number(values); // deduce radix - if (isNaN(value)) + if (isNaN(value) || value != parseInt(value)) return "E521: Number required"; switch (operator)