Permalink
Browse files

Provide noop for arg-less Test#cb

  • Loading branch information...
5long committed Dec 3, 2010
1 parent 22f90ac commit e8209d52468c34bb29097747eaea9c9fa60b5707
Showing with 2 additions and 0 deletions.
  1. +1 −0 src/test.js
  2. +1 −0 src/util.js
View
@@ -67,6 +67,7 @@ util.def(Test.prototype, {
this.emit("notice", msg)
}
, cb: function Self(fn, msg) {
+ fn = fn || util.noop
// Hacky and incomplete, but it's the best I can do.
var err = prepareError(fn, "not called", msg, "()", Self)
return this._ensureExecute(fn, msg, err)
View
@@ -2,6 +2,7 @@ var makeArray = Function.prototype.call.bind(Array.prototype.slice)
var util = module.exports = {
makeArray: makeArray
+, noop : function NOOP() {}
, isFunc: isFunc
, defer: defer
, pushAll: Function.prototype.apply.bind(Array.prototype.push)

0 comments on commit e8209d5

Please sign in to comment.