docs: function when(args, cb, eb) {
      var p;
      args = argsToArray(arguments);
      eb = base.isFunction(args[args.length - 1]) ? args.pop() : null;
      cb = base.isFunction(args[args.length - 1]) ? args.pop() : null;
      if (eb && !cb) {
          cb = eb;
          eb = null;
      }
      if (!args.length) {
          p = new Promise().callback(args);
      } else if (args.length === 1) {
          args = args.pop();
          if (isPromiseLike(args)) {
              p = args;
          } else if (isArray(args) && array.every(args, isPromiseLike)) {
              p = new PromiseList(args, true);
          } else {
              p = new Promise().callback(args);
          }
      } else {
          p = new PromiseList(args.map(function (a) {
              return isPromiseLike(a) ? a : new Promise().callback(a);
          }), true);
      }
      if (cb) {
          p.addCallback(cb);
      }
      if (eb) {
          p.addErrback(eb);
      }
      return p.promise();
  
  }