Chromium Code Reviews| Index: remoting/webapp/crd/js/it2me_helpee_channel.js |
| diff --git a/remoting/webapp/crd/js/it2me_helpee_channel.js b/remoting/webapp/crd/js/it2me_helpee_channel.js |
| index bcce9bd4535a1db586701999fba3a2c65a266d8f..44423d28671293678b7e1a634be0f4702125d56a 100644 |
| --- a/remoting/webapp/crd/js/it2me_helpee_channel.js |
| +++ b/remoting/webapp/crd/js/it2me_helpee_channel.js |
| @@ -188,8 +188,8 @@ remoting.It2MeHelpeeChannel.prototype.onHangoutMessage_ = function(message) { |
| return true; |
| } |
| throw new Error('Unsupported message method=' + message.method); |
| - } catch(e) { |
| - var error = /** @type {Error} */ e; |
| + } catch(/** @type {*} */ e) { |
|
kelvinp
2015/01/12 22:51:28
Is is possible to do the following on line 191
} c
garykac
2015/01/13 00:28:39
Done.
|
| + var error = /** @type {Error} */ (e); |
| this.sendErrorResponse_(message, error.message); |
| } |
| return false; |
| @@ -217,7 +217,7 @@ remoting.It2MeHelpeeChannel.prototype.handleIsHostInstalled_ = |
| this.hostInstaller_.isInstalled().then( |
| sendResponse, |
| - this.sendErrorResponse_.bind(this, message) |
| + /** @type {function(*):void} */(this.sendErrorResponse_.bind(this, message)) |
| ); |
| }; |
| @@ -228,8 +228,8 @@ remoting.It2MeHelpeeChannel.prototype.handleIsHostInstalled_ = |
| remoting.It2MeHelpeeChannel.prototype.handleDownloadHost_ = function(message) { |
| try { |
| this.hostInstaller_.download(); |
| - } catch (e) { |
| - var error = /** @type {Error} */ e; |
| + } catch (/** @type {*} */ e) { |
| + var error = /** @type {Error} */ (e); |
| this.sendErrorResponse_(message, error.message); |
| } |
| }; |
| @@ -265,8 +265,8 @@ remoting.It2MeHelpeeChannel.prototype.handleConnect_ = |
| ).then( |
| this.fetchOAuthToken_.bind(this) |
| ).then( |
| - this.connectToHost_.bind(this, email), |
| - this.sendErrorResponse_.bind(this, message) |
| + /** @type {function(*):void} */(this.connectToHost_.bind(this, email)), |
| + /** @type {function(*):void} */(this.sendErrorResponse_.bind(this, message)) |
| ); |
| }; |
| @@ -335,7 +335,7 @@ remoting.It2MeHelpeeChannel.prototype.showConfirmDialogV2_ = function() { |
| /** @param {number} result */ |
| function confirmDialogCallback(result) { |
| if (result === 1) { |
| - resolve(); |
| + resolve(true); |
| } else { |
| reject(new Error(remoting.Error.CANCELLED)); |
| } |
| @@ -366,9 +366,10 @@ remoting.It2MeHelpeeChannel.prototype.initializeHost_ = function() { |
| */ |
| return new Promise(function(resolve, reject) { |
| if (host.initialized()) { |
| - resolve(); |
| + resolve(true); |
| } else { |
| - host.initialize(resolve, reject); |
| + host.initialize(/** @type {function(*=):void} */ (resolve), |
| + /** @type {function(*=):void} */ (reject)); |
| } |
| }); |
| }; |