1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-22 21:55:45 +01:00

Stricter number option parsing (and comment out some dump statements)

This commit is contained in:
Kris Maglione
2009-01-28 09:15:26 -05:00
parent a29e5246d1
commit 70022ff0af
4 changed files with 7 additions and 10 deletions

View File

@@ -1120,7 +1120,7 @@ function Events() //{{{
waitForPageLoad: function () 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 liberator.threadYield(true); // clear queue
if (buffer.loaded == 1) if (buffer.loaded == 1)
@@ -1133,8 +1133,8 @@ function Events() //{{{
while (now = Date.now(), now < end) while (now = Date.now(), now < end)
{ {
liberator.threadYield(); liberator.threadYield();
if ((now - start) % 1000 < 10) //if ((now - start) % 1000 < 10)
liberator.dump("waited: " + (now - start) + " ms"); // liberator.dump("waited: " + (now - start) + " ms");
if (!events.feedingKeys) if (!events.feedingKeys)
return false; return false;
@@ -1153,7 +1153,7 @@ function Events() //{{{
let ret = (buffer.loaded == 1); let ret = (buffer.loaded == 1);
if (!ret) if (!ret)
liberator.echoerr("Page did not load completely in " + maxWaitTime + " seconds. Macro stopped."); 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 // sometimes the input widget had focus when replaying a macro
// maybe this call should be moved somewhere else? // maybe this call should be moved somewhere else?
@@ -1217,7 +1217,7 @@ function Events() //{{{
{ {
if (config.isComposeWindow) if (config.isComposeWindow)
{ {
liberator.dump("Compose editor got focus"); //liberator.dump("Compose editor got focus");
modes.set(modes.INSERT, modes.TEXTAREA); modes.set(modes.INSERT, modes.TEXTAREA);
} }
else if (liberator.mode != modes.MESSAGE) else if (liberator.mode != modes.MESSAGE)

View File

@@ -510,8 +510,6 @@ function Hints() //{{{
return function (linkText) return function (linkText)
{ {
liberator.dump(hintStrings);
if (hintStrings.length == 1 && hintStrings[0].length == 0) if (hintStrings.length == 1 && hintStrings[0].length == 0)
return true; return true;

View File

@@ -1417,7 +1417,6 @@ window.liberator = liberator;
// FIXME: Ugly, etc. // FIXME: Ugly, etc.
window.addEventListener("liberatorHelpLink", function (event) { window.addEventListener("liberatorHelpLink", function (event) {
let elem = event.target; let elem = event.target;
liberator.dump(String(elem));
if (/^(option|mapping|command)$/.test(elem.className)) if (/^(option|mapping|command)$/.test(elem.className))
var tag = elem.textContent.replace(/\s.*/, ""); var tag = elem.textContent.replace(/\s.*/, "");
if (elem.className == "command") if (elem.className == "command")

View File

@@ -203,9 +203,9 @@ Option.prototype = {
break; break;
case "number": 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"; return "E521: Number required";
switch (operator) switch (operator)