text: export const shim = function() {
  
    // 处理 requestAnimationFrame 和 cancelAnimationFrame
    var lastTime = 0;
    var vendors = ['webkit', 'moz'];
    for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
      window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
      window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||    // name has changed in Webkit
                                    window[vendors[x] + 'CancelRequestAnimationFrame'];
    }
  
    if (!window.requestAnimationFrame) {
      window.requestAnimationFrame = function(callback, element) {
        var currTime = new Date().getTime();
        var timeToCall = Math.max(0, 16.7 - (currTime - lastTime));
        var id = window.setTimeout(function() {
          callback(currTime + timeToCall);
        }, timeToCall);
        lastTime = currTime + timeToCall;
        return id;
      };
    }
    if (!window.cancelAnimationFrame) {
      window.cancelAnimationFrame = function(id) {
        clearTimeout(id);
      };
    }
  
    // 处理 performance.now
  
    if ("performance" in window == false) {
      window.performance = {};
    }
  
    Date.now = (Date.now || function () {  // thanks IE8
  	  return new Date().getTime();
    });
  
    if ("now" in window.performance == false){
  
      var nowOffset = Date.now();
  
      if (performance.timing && performance.timing.navigationStart){
        nowOffset = performance.timing.navigationStart
      }
  
      window.performance.now = function now(){
        return Date.now() - nowOffset;
      }
    }
  }
  
  export const findIndex = function () {
    if (!Array.prototype.findIndex) {
      Object.defineProperty(Array.prototype, 'findIndex', {
          value: function(predicate) {
              'use strict';
              if (this == null) {
                  throw new TypeError('Array.prototype.findIndex called on null or undefined');
              }
              if (typeof predicate !== 'function') {
                  throw new TypeError('predicate must be a function');
              }
              var list = Object(this);
              var length = list.length >>> 0;
              var thisArg = arguments[1];
              var value;
  
              for (var i = 0; i < length; i++) {
                  value = list[i];
                  if (predicate.call(thisArg, value, i, list)) {
                      return i;
                  }
              }
              return -1;
          },
          enumerable: false,
          configurable: false,
          writable: false
      });
    }
  }
  
  