[Pkg-mozext-commits] [firebug] 03/16: Issue 7729: Global properties starting with numbers show up in auto-completion

David Prévot taffit at moszumanska.debian.org
Fri Feb 6 17:18:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit b95287be88d93045e1a9312d89f315fcd4d0e36e
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date:   Wed Dec 31 11:05:27 2014 +0100

    Issue 7729: Global properties starting with numbers show up in auto-completion
    
    https://code.google.com/p/fbug/issues/detail?id=7729
---
 extension/content/firebug/console/autoCompleter.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/extension/content/firebug/console/autoCompleter.js b/extension/content/firebug/console/autoCompleter.js
index e470c49..6b61ea5 100644
--- a/extension/content/firebug/console/autoCompleter.js
+++ b/extension/content/firebug/console/autoCompleter.js
@@ -1864,7 +1864,7 @@ function setCompletionsFromObject(out, object, context)
                 // The object is a large array. To avoid RangeErrors from
                 // `target.push.apply` and a slow `Object.getOwnPropertyNames`,
                 // we just skip this level ("length" is also on the prototype,
-                // and numeric property would get hidden later anyway).
+                // and numeric properties would get hidden later anyway).
             }
             else
             {
@@ -2390,6 +2390,14 @@ function autoCompleteEval(context, preExpr, spreExpr, preParsed, spreParsed, opt
             });
         }
 
+        if (!spreExpr)
+        {
+            // For global completions, hide results starting with a digit, since they conflict
+            // with typing numbers. An interested user would type 'window.<name>', anyway.
+            var reValid = /^[^0-9]/;
+            out.completions = out.completions.filter((x) => reValid.test(x));
+        }
+
         // Sort the completions, and avoid duplicates.
         // Note: If we make it possible to show both regular and hidden completions
         // at the same time, completions should shadow hiddenCompletions here.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list