Chromium Code Reviews| Index: ui/webui/resources/js/cr.js |
| diff --git a/ui/webui/resources/js/cr.js b/ui/webui/resources/js/cr.js |
| index 984a5c25df05cf9cd2e9dafe5c79fe86c2843b6a..ddf7c87950035ee6e80710ee474a3b46aadfce2f 100644 |
| --- a/ui/webui/resources/js/cr.js |
| +++ b/ui/webui/resources/js/cr.js |
| @@ -331,15 +331,12 @@ var cr = function() { |
| * supply any number of other arguments that will be included in the response. |
| * @param {string} id The unique ID identifying the Promise this response is |
| * tied to. |
| - * @param {...*} var_args Variable number of arguments to be included in the |
| - * response. |
| + * @param {*} response The response as sent from C++. |
| */ |
| - function webUIResponse(id, var_args) { |
| + function webUIResponse(id, response) { |
| var resolverFn = chromeSendResolverMap[id]; |
| delete chromeSendResolverMap[id]; |
| - // Promise#resolve accepts only one value, therefore wrapping all arguments |
| - // passed from C++ to JS in an array. |
| - resolverFn(Array.prototype.slice.call(arguments, 1)); |
|
Dan Beam
2016/01/27 00:23:57
why did you change this?
dpapad
2016/01/27 00:45:24
Explained better in CL description. On top of that
Dan Beam
2016/01/27 02:30:44
I saw that
|
| + resolverFn(response); |
| } |
| /** |
| @@ -355,7 +352,7 @@ var cr = function() { |
| return new Promise(function(resolve, reject) { |
| var id = methodName + '_' + createUid(); |
| chromeSendResolverMap[id] = resolve; |
| - chrome.send(methodName, ['cr.webUIResponse', id].concat(args)); |
| + chrome.send(methodName, [id].concat(args)); |
| }); |
| } |