Skip to content

Commit

Permalink
Made the callback optional
Browse files Browse the repository at this point in the history
As suggested in fb55#8
  • Loading branch information
fb55 committed Dec 20, 2011
1 parent 539cdb8 commit 1289e0a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/DefaultHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ function DefaultHandler(callback, options){
this._done = false;
this._inSpecialTag = false;
this._tagStack = [];
if(options) this._options = options; //otherwise, the prototype is used
if(callback) this._callback = callback;
if(typeof callback === "object") this._options = callback;
else {
if(options) this._options = options; //otherwise, the prototype is used
if(callback) this._callback = callback;
}
}

//default options
Expand Down

0 comments on commit 1289e0a

Please sign in to comment.