[Pkg-mozext-commits] [greasemonkey] 03/45: Move function declaration out of conditional block.
David Prévot
taffit at moszumanska.debian.org
Mon Nov 3 20:59:18 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit 4afb79a50702084f9807337b9204c30208b94095
Author: Ventero <ventero at ventero.de>
Date: Sat Aug 30 04:43:01 2014 +0200
Move function declaration out of conditional block.
---
modules/script.js | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/modules/script.js b/modules/script.js
index 58ecb8b..5e29064 100644
--- a/modules/script.js
+++ b/modules/script.js
@@ -147,20 +147,20 @@ 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).
- if (!this._localized) {
- var locales = this._locales;
- var preferred = GM_util.getPreferredLocale();
+ function getBestLocalization(aProp) {
+ var available = Object.keys(locales).filter(function(locale) {
+ return !!locales[locale][aProp];
+ });
- function getBestLocalization(aProp) {
- var available = Object.keys(locales).filter(function(locale) {
- return !!locales[locale][aProp];
- });
+ var bestMatch = GM_util.getBestLocaleMatch(preferred, available);
+ if (!bestMatch) return null;
- var bestMatch = GM_util.getBestLocaleMatch(preferred, available);
- if (!bestMatch) return null;
+ return locales[bestMatch][aProp];
+ }
- return locales[bestMatch][aProp];
- }
+ if (!this._localized) {
+ var locales = this._locales;
+ var preferred = GM_util.getPreferredLocale();
this._localized = {
description: getBestLocalization("description") || this._description,
--
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