code: function nextTick(fn, thisArg) {
      if (thisArg) {
          fn = bind(fn, thisArg);
      }
      nextTasks.push(fn);
  
      if (nextHandler) {
          return;
      }
  
      nextHandler = function () {
          var tasks = nextTasks.slice(0);
          nextTasks = [];
          nextHandler = null;
  
          for (var i = 0, l = tasks.length; i < l; i++) {
              tasks[i]();
          }
      };
  
      // 非标准方法，但是此方法非常吻合要求。
      /* istanbul ignore next */
      if (typeof setImmediate === 'function') {
          setImmediate(nextHandler);
      }
      // 用MessageChannel去做setImmediate的polyfill
      // 原理是将新的message事件加入到原有的dom events之后
      else if (typeof MessageChannel === 'function') {
          var channel = new MessageChannel();
          var port = channel.port2;
          channel.port1.onmessage = nextHandler;
          port.postMessage(1);
      }
      // for native app
      else if (isNativePromise) {
          Promise.resolve().then(nextHandler);
      }
      else {
          setTimeout(nextHandler, 0);
      }
  }
docs: 在下一个时间周期运行任务
  
  @inner
  @param {Function} fn 要运行的任务函数
  @param {Object=} thisArg this指向对象