From 172900fff2493642024f9538153c6adf3ea71a99 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 2 Jan 2009 21:01:56 +1100 Subject: [PATCH] Declare a variable in "gi" action. --- common/content/buffer.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index bc17396d..70b3f9e1 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -330,7 +330,7 @@ function Buffer() //{{{ "//xhtml:input[not(@type) or @type='text' or @type='password'] | //xhtml:textarea[not(@disabled) and not(@readonly)]" ); - for (match in matches) + for (let match in matches) { let computedStyle = util.computedStyle(match); if (computedStyle.visibility != "hidden" && computedStyle.display != "none") @@ -339,11 +339,7 @@ function Buffer() //{{{ if (elements.length > 0) { - if (count > elements.length) - count = elements.length; - else if (count < 1) - count = 1; - + count = Math.min(Math.max(count, 1), elements.length); elements[count - 1].focus(); } else