[Pkg-mozext-commits] [greasemonkey] 31/55: Set script properties to empty string, not null.

David Prévot taffit at moszumanska.debian.org
Thu Oct 29 15:38:05 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 be1d16f7882d678d93df2a524a76f8ed0e3f0535
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Thu Sep 24 10:29:14 2015 -0400

    Set script properties to empty string, not null.
    
    Also only populate addon creator if author is known.
    
    Fixes #1944
---
 modules/addons4.js | 6 ++++--
 modules/script.js  | 8 ++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/addons4.js b/modules/addons4.js
index 3abc189..63f42b0 100755
--- a/modules/addons4.js
+++ b/modules/addons4.js
@@ -89,10 +89,12 @@ function ScriptAddonFactoryById(aId) {
 function ScriptAddon(aScript) {
   this._script = aScript;
 
-  this.creator = {
+  if (this._script.author) {
+    this.creator = {
       name: this._script.author,
       url: this._script.homepageURL,
-  };
+    };
+  }
   this.description = this._script.localized.description;
   this.forceUpdate = false;
   this.homepageURL = this._script.homepageURL;
diff --git a/modules/script.js b/modules/script.js
index 3d2ce74..627d558 100644
--- a/modules/script.js
+++ b/modules/script.js
@@ -117,7 +117,7 @@ Script.prototype.changed = Script.prototype._changed;
 Script.prototype.__defineGetter__('author',
 function Script_getAuthor() { return this._author; });
 Script.prototype.__defineSetter__('author',
-function Script_setAuthor(aVal) { this._author = '' + aVal; });
+function Script_setAuthor(aVal) { this._author = aVal ? '' + aVal : ''; });
 
 Script.prototype.__defineGetter__('installDate',
 function Script_getInstallDate() { return new Date(this._installTime); });
@@ -185,12 +185,12 @@ function Script_getLocalizedDescription() {
 Script.prototype.__defineGetter__('downloadURL',
 function Script_getDownloadUrl() { return this._downloadURL; });
 Script.prototype.__defineSetter__('downloadURL',
-function Script_setDownloadUrl(aVal) { this._downloadURL = '' + aVal; });
+function Script_setDownloadUrl(aVal) { this._downloadURL = aVal ? '' + aVal : ''; });
 
 Script.prototype.__defineGetter__('homepageURL',
 function Script_getHomepageUrl() { return this._homepageURL; });
 Script.prototype.__defineSetter__('homepageURL',
-function Script_setHomepageUrl(aVal) { this._homepageURL = '' + aVal; });
+function Script_setHomepageUrl(aVal) { this._homepageURL = aVal ? '' + aVal : ''; });
 
 Script.prototype.__defineGetter__('uuid',
 function Script_getUuid() { return this._uuid; });
@@ -511,7 +511,7 @@ Script.prototype.toConfigNode = function(doc) {
 
   scriptNode.appendChild(doc.createTextNode("\n\t"));
 
-  scriptNode.setAttribute("author", this._author);
+  this._author && scriptNode.setAttribute("author", this._author);
   scriptNode.setAttribute("basedir", this._basedir);
   scriptNode.setAttribute("checkRemoteUpdates", this.checkRemoteUpdates);
   scriptNode.setAttribute("dependhash", this._dependhash);

-- 
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