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

Side by Side Diff: polymer_1.2.3/bower_components/promise-polyfill/Promise-Statics.js

Issue 1581713003: [third_party] add polymer 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: 1.2.3 Created 4 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
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