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
This commit is contained in:
parent
013af36855
commit
338bb54fdc
2 changed files with 6 additions and 1 deletions
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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++){
|
||||
|
|
Loading…
Reference in a new issue