packages/promise-addition/src/static-members.js
function run(index) {
        if (index >= len || error) return Promise.resolve();
        next += 1;

        try {
          return Promise.resolve(iterator(arr[index], index)).then((ret) => {
            result[index] = ret;
            return run(next);
          }, (err) => {
            error = err;
            return Promise.reject(err);
          });
        } catch (e) {
          return Promise.reject(e);
        }
      }
function run(index) {
        if (index >= len || error) return Promise.resolve();
        next += 1;

        try {
          return Promise.resolve(iterator(arr[index], index)).then((ret) => {
            result[index] = ret;
            return run(next);
          }, (err) => {
            error = err;
            return Promise.reject(err);
          });
        } catch (e) {
          return Promise.reject(e);
        }
      }
function run ( index ) { if ( index >= len || error ) return Promise . resolve ( ) ; next += 1 ; try { return Promise . resolve ( iterator ( arr [ index ] , index ) ) . then ( ( ret ) => { result [ index ] = ret ; return run ( next ) ; } , ( err ) => { error = err ; return Promise . reject ( err ) ; } ) ; } catch ( e ) { return Promise . reject ( e ) ; } }
if an error occured, all remain ones will not be run
if an error occured all remain ones will not be run