Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/platform/utilities.js

Issue 2615083002: DevTools: setImmediate polyfill should handle arguments (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 * @param {*} value 1360 * @param {*} value
1361 */ 1361 */
1362 function suppressUnused(value) { 1362 function suppressUnused(value) {
1363 } 1363 }
1364 1364
1365 /** 1365 /**
1366 * @param {function()} callback 1366 * @param {function()} callback
1367 * @return {number} 1367 * @return {number}
1368 */ 1368 */
1369 self.setImmediate = function(callback) { 1369 self.setImmediate = function(callback) {
1370 Promise.resolve().then(callback); 1370 const args = [...arguments].slice(1);
1371 Promise.resolve().then(_ => callback(...args));
pfeldman 2017/01/06 00:08:51 nit: () =>
1371 return 0; 1372 return 0;
1372 }; 1373 };
1373 1374
1374 /** 1375 /**
1375 * @param {function(...?)} callback 1376 * @param {function(...?)} callback
1376 * @return {!Promise.<T>} 1377 * @return {!Promise.<T>}
1377 * @template T 1378 * @template T
1378 */ 1379 */
1379 Promise.prototype.spread = function(callback) { 1380 Promise.prototype.spread = function(callback) {
1380 return this.then(spreadPromise); 1381 return this.then(spreadPromise);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 while (leftIndex < leftKeys.length) { 1434 while (leftIndex < leftKeys.length) {
1434 var leftKey = leftKeys[leftIndex++]; 1435 var leftKey = leftKeys[leftIndex++];
1435 removed.push(this.get(leftKey)); 1436 removed.push(this.get(leftKey));
1436 } 1437 }
1437 while (rightIndex < rightKeys.length) { 1438 while (rightIndex < rightKeys.length) {
1438 var rightKey = rightKeys[rightIndex++]; 1439 var rightKey = rightKeys[rightIndex++];
1439 added.push(other.get(rightKey)); 1440 added.push(other.get(rightKey));
1440 } 1441 }
1441 return {added: added, removed: removed, equal: equal}; 1442 return {added: added, removed: removed, equal: equal};
1442 }; 1443 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698