code: function then(resolver, onFulfilled, onRejected) {
          var res = new Resolver();
          var promise = createPromise(res);
  
          if (isFunction(onFulfilled)) {
              onFulfilled = wrapCallback(res, promise, onFulfilled);
          }
          else {
              // not function
              // 'return promise' must fulfill with the same value
              // when 'main promise' is resolved
              // see #2.2.7.3
              onFulfilled = function (data) {
                  res.fulfill(data);
              };
          }
          addListener(resolver, STATUS.FULFILLED, onFulfilled);
  
          if (isFunction(onRejected)) {
              onRejected = wrapCallback(res, promise, onRejected);
          }
          else {
              // not function
              // 'return promise' must reject with the same reason
              // when 'main promise' is rejected
              // see #2.2.7.4
              onRejected = function (reason) {
                  res.reject(reason);
              };
          }
          addListener(resolver, STATUS.REJECTED, onRejected);
  
          return promise;
      }
docs: then
  将fulfill回调与reject回调注册到resolver上
  并返回新的Promise对象
  
  @inner
  @param {Resolver} resolver resolver对象
  @param {Function} onFulfilled 成功回调
  @param {Function} onRejected 失败回调
  @return {Promise}