[Pkg-mozext-commits] [greasemonkey] 18/41: Do not return a void default from GM_getValue().
David Prévot
taffit at moszumanska.debian.org
Thu Apr 30 22:06:33 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 97df401b342b471393b9f36a4daa91f8d3557d5f
Author: Anthony Lieuallen <arantius at gmail.com>
Date: Thu Apr 2 15:57:25 2015 -0400
Do not return a void default from GM_getValue().
Also, if a void is passed into GM_setValue(), coerce it to null.
Fixes #2121
---
modules/storageFront.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules/storageFront.js b/modules/storageFront.js
index 1bb6e82..075ca51 100644
--- a/modules/storageFront.js
+++ b/modules/storageFront.js
@@ -47,6 +47,7 @@ GM_ScriptStorageFront.prototype.setValue = function(name, val) {
throw new Error(this.stringBundle.GetStringFromName('error.args.setValue'));
}
+ if ('undefined' == typeof val) val = null;
this._messageManager.sendSyncMessage(
'greasemonkey:scriptVal-set',
{scriptId: this._script.id, name: name, val: val});
@@ -59,6 +60,7 @@ GM_ScriptStorageFront.prototype.getValue = function(name, defVal) {
{scriptId: this._script.id, name: name});
value = value.length && value[0];
+ if ('undefined' == typeof defVal) defVal = null;
if (value === undefined || value === null) return defVal;
try {
--
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