From 338bb54fdca009cc69f61394c3205ad0763a3c5d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 2 Jun 2006 20:51:34 +0000 Subject: [PATCH] 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 --- chrome/chromeFiles/content/scholar/xpcom/notifier.js | 2 +- chrome/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 index d250ac7b6..92cc45dc6 100644 --- 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 index eadd95afc..25009ccb9 100644 --- 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