safer bind

This commit is contained in:
Thomas Aylott 2013-10-31 19:05:32 -04:00
parent db299ed761
commit 772af52f4a
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ module.exports = function(){
.get(this.data.url)
.then(function(){return browser;})
.then(getJSReport)
.then(this.data.onComplete.bind(browser), this.data.onError.bind(browser))
.then(this.data.onComplete && this.data.onComplete.bind(browser), this.data.onError && this.data.onError.bind(browser))
.fin(browser.quit.bind(browser))
.done(taskSucceeded.bind(null,true), taskSucceeded.bind(null,false))
;