[Pkg-mozext-commits] [firebug] 06/82: Issue 6135: Numeric properties should be shown in auto-completion
David Prévot
taffit at moszumanska.debian.org
Mon Mar 31 22:45:35 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag fbtest-1.11.2
in repository firebug.
commit 0f657cc5a8f04e0b5c9553d5c57982f33542895a
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date: Wed Dec 19 17:47:03 2012 +0100
Issue 6135: Numeric properties should be shown in auto-completion
http://code.google.com/p/fbug/issues/detail?id=6135
---
extension/content/firebug/console/autoCompleter.js | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/extension/content/firebug/console/autoCompleter.js b/extension/content/firebug/console/autoCompleter.js
index 2a23b88..fcb1ce1 100644
--- a/extension/content/firebug/console/autoCompleter.js
+++ b/extension/content/firebug/console/autoCompleter.js
@@ -2105,9 +2105,9 @@ function autoCompleteEval(context, preExpr, spreExpr, includeCurrentScope)
}
}
- // Add "] to properties if we are doing index-completions.
if (indexCompletion)
{
+ // If we are doing index-completions, add "] to everything.
function convertQuotes(x)
{
x = (out.indexQuoteType === '"') ? Str.escapeJS(x): Str.escapeSingleQuoteJS(x);
@@ -2116,15 +2116,15 @@ function autoCompleteEval(context, preExpr, spreExpr, includeCurrentScope)
out.completions = out.completions.map(convertQuotes);
out.hiddenCompletions = out.hiddenCompletions.map(convertQuotes);
}
-
- // Remove numeric keys.
- var rePositiveNumber = /^[1-9][0-9]*$/;
- var nonNumeric = function(x)
+ else if (out.completions.indexOf("length") !== -1 && out.completions.indexOf("0") !== -1)
{
- return x !== '0' && !rePositiveNumber.test(x);
+ // ... otherwise remove numeric keys from array-like things.
+ var rePositiveNumber = /^[1-9][0-9]*$/;
+ out.completions = out.completions.filter(function(x)
+ {
+ return !rePositiveNumber.test(x) && x !== "0";
+ });
}
- out.completions = out.completions.filter(nonNumeric);
- out.hiddenCompletions = out.hiddenCompletions.filter(nonNumeric);
// Sort the completions, and avoid duplicates.
// XXX: If we make it possible to show both regular and hidden completions
--
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