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

Side by Side Diff: third_party/polymer/v0_8/components-chromium/promise-polyfill/Promise-Statics.js

Issue 1162963002: Revert "Rename polymer and cr_elements v0_8 to v1_0" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 Promise.all = Promise.all || function () { 1 Promise.all = Promise.all || function () {
2 var args = Array.prototype.slice.call(arguments.length === 1 && Array.isArray( arguments[0]) ? arguments[0] : arguments); 2 var args = Array.prototype.slice.call(arguments.length === 1 && Array.isArray( arguments[0]) ? arguments[0] : arguments);
3 3
4 return new Promise(function (resolve, reject) { 4 return new Promise(function (resolve, reject) {
5 if (args.length === 0) return resolve([]); 5 if (args.length === 0) return resolve([]);
6 var remaining = args.length; 6 var remaining = args.length;
7 function res(i, val) { 7 function res(i, val) {
8 try { 8 try {
9 if (val && (typeof val === 'object' || typeof val === 'function')) { 9 if (val && (typeof val === 'object' || typeof val === 'function')) {
10 var then = val.then; 10 var then = val.then;
(...skipping 17 matching lines...) Expand all
28 }; 28 };
29 29
30 Promise.race = Promise.race || function (values) { 30 Promise.race = Promise.race || function (values) {
31 return new Promise(function (resolve, reject) { 31 return new Promise(function (resolve, reject) {
32 for(var i = 0, len = values.length; i < len; i++) { 32 for(var i = 0, len = values.length; i < len; i++) {
33 values[i].then(resolve, reject); 33 values[i].then(resolve, reject);
34 } 34 }
35 }); 35 });
36 }; 36 };
37 37
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698