[Pkg-mozext-commits] [greasemonkey] 28/43: rearrange syntax to silence IDE warnings
David Prévot
taffit at moszumanska.debian.org
Sun Feb 22 21:56:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit d750e88aa7e8d3c374ac9823f9b4fec65544c0e4
Author: Anthony Lieuallen <arantius at gmail.com>
Date: Wed Jan 7 14:17:54 2015 -0500
rearrange syntax to silence IDE warnings
---
modules/script.js | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/modules/script.js b/modules/script.js
index 6303126..6732fd5 100644
--- a/modules/script.js
+++ b/modules/script.js
@@ -151,23 +151,21 @@ function Script_getLocalizedDescription() {
// We can't simply return this._locales[locale], as the best match for name
// and description might be for different locales (e.g. if an exact match is
// only provided for one of them).
- function getBestLocalization(aProp) {
- var available = Object.keys(locales).filter(function(locale) {
- return !!locales[locale][aProp];
+ function getBestLocalization(aLocales, aProp) {
+ var available = Object.keys(aLocales).filter(function(locale) {
+ return !!aLocales[locale][aProp];
});
- var bestMatch = GM_util.getBestLocaleMatch(preferred, available);
+ var bestMatch = GM_util.getBestLocaleMatch(
+ GM_util.getPreferredLocale(), available);
if (!bestMatch) return null;
- return locales[bestMatch][aProp];
+ return aLocales[bestMatch][aProp] || this._description;
}
if (!this._localized) {
- var locales = this._locales;
- var preferred = GM_util.getPreferredLocale();
-
this._localized = {
- description: getBestLocalization("description") || this._description,
+ description: getBestLocalization(this._locales, "description"),
name: getBestLocalization("name") || this._name
};
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git
More information about the Pkg-mozext-commits
mailing list