@samitouri / QOS-React-2 / commits / 772af52f4a

safer bind

Thomas Aylott committed Oct 31, 2013 at 19:05 UTC 772af52f4ae37a8358ddb407c034890894e96986
1 file changed +1 -1
grunt/tasks/webdriver-jasmine.js
+1 -1
@@ -18,7 +18,7 @@ module.exports = function(){
18 .get(this.data.url)
19 .then(function(){return browser;})
20 .then(getJSReport)
21 - .then(this.data.onComplete.bind(browser), this.data.onError.bind(browser))
21 + .then(this.data.onComplete && this.data.onComplete.bind(browser), this.data.onError && this.data.onError.bind(browser))
22 .fin(browser.quit.bind(browser))
23 .done(taskSucceeded.bind(null,true), taskSucceeded.bind(null,false))
24 ;