Index: remoting/webapp/crd/js/xhr.js |
diff --git a/remoting/webapp/crd/js/xhr.js b/remoting/webapp/crd/js/xhr.js |
index f159fb61c00628fde4336852bc5e213c4b149f7e..bb60b87f5949e73db40661a0fbb13596194fe765 100644 |
--- a/remoting/webapp/crd/js/xhr.js |
+++ b/remoting/webapp/crd/js/xhr.js |
@@ -188,7 +188,8 @@ remoting.xhr.doMethod = function(methodName, url, onDone, |
return xhr; |
}; |
-/** Generic success/failure response proxy. |
+/** |
+ * Generic success/failure response proxy. |
* |
* @param {function():void} onDone |
* @param {function(remoting.Error):void} onError |
@@ -196,13 +197,14 @@ remoting.xhr.doMethod = function(methodName, url, onDone, |
*/ |
remoting.xhr.defaultResponse = function(onDone, onError) { |
/** @param {XMLHttpRequest} xhr */ |
- return function(xhr) { |
+ var result = function(xhr) { |
/** @type {remoting.Error} */ |
- var error = remoting.Error.fromHttpError(xhr.status) |
+ var error = remoting.Error.fromHttpError(/** @type {number} */ (xhr.status)) |
if (error == remoting.Error.NONE) { |
onDone(); |
} else { |
onError(error); |
} |
}; |
+ return result; |
}; |