safer bind
This commit is contained in:
parent
db299ed761
commit
772af52f4a
|
@ -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))
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue