www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 338bb54fdca009cc69f61394c3205ad0763a3c5d
parent 013af36855fd9e412f8f6d2f296af348eaccc8fd
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri,  2 Jun 2006 20:51:34 +0000

Adjust flattenArguments() to properly handle scalar values -- so now it can be passed pretty much anything and just return a flattened array

Fixed typo in notifier debug() statement



Diffstat:
Mchrome/chromeFiles/content/scholar/xpcom/notifier.js | 2+-
Mchrome/chromeFiles/content/scholar/xpcom/scholar.js | 5+++++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/chrome/chromeFiles/content/scholar/xpcom/notifier.js b/chrome/chromeFiles/content/scholar/xpcom/notifier.js @@ -74,7 +74,7 @@ Scholar.Notifier = new function(){ } function _unregister(type, hash){ - Scholar.debug("Unregistering ' + type + ' in notifier with hash '" + hash + "'", 4); + Scholar.debug("Unregistering " + type + " in notifier with hash '" + hash + "'", 4); delete _observers[type][hash]; } } diff --git a/chrome/chromeFiles/content/scholar/xpcom/scholar.js b/chrome/chromeFiles/content/scholar/xpcom/scholar.js @@ -146,6 +146,11 @@ var Scholar = new function(){ * values and/or an arbitrary number of individual values */ function flattenArguments(args){ + // Put passed scalar values into an array + if (typeof args!='object'){ + args = [args]; + } + var returns = new Array(); for (var i=0; i<args.length; i++){