promise-es6.js 824 B

123456789101112131415161718
  1. (function (name, factory) {
  2. if (typeof define === 'function' && (define.amd || define.cmd)) {
  3. define([], factory);
  4. } else if (typeof window !== "undefined" || typeof self !== "undefined") {
  5. // var global = typeof window !== "undefined" ? window : self;
  6. // global[name] = factory();
  7. // if(typeof global.Promise == "function"){
  8. // global[name].auto(global.Promise);
  9. // }
  10. } else {
  11. throw new Error("加载 " + name + " 模块失败!,请检查您的环境!")
  12. }
  13. })('extendPromise',function(){
  14. var global = typeof window !== "undefined" ? window : self;
  15. if(typeof global.Promise !== "function") throw Error('需要Promise,但未找到,请尝试使用"promise-full.js"');
  16. var P = require("../src/polyfills")(global.Promise)
  17. return P;
  18. });