From 5bdf0099810cd58f2dff6dbb1f3c52b3d99536a9 Mon Sep 17 00:00:00 2001 From: Ariyan Khan Date: Thu, 15 Jun 2017 23:00:49 +0530 Subject: [PATCH] [Build] Project --- dist/es6-promise-shim.min.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 dist/es6-promise-shim.min.js diff --git a/dist/es6-promise-shim.min.js b/dist/es6-promise-shim.min.js new file mode 100644 index 0000000..342e2d4 --- /dev/null +++ b/dist/es6-promise-shim.min.js @@ -0,0 +1 @@ +!function(e,n){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=n(e):n(e)}("undefined"!=typeof window?window:global,function(e){"use strict";var n=Object.defineProperty,t=Object.defineProperties,r=Array.prototype.slice,i=(Array.prototype.forEach,Array.isArray),o=Math.floor,u=Math.abs,c="object"==typeof e.ES6?e.ES6:e.ES6={},f=Math.max,l=(Math.min,function(e){return"function"==typeof e}),s=function(e){return null!==e&&("object"==typeof e||"function"==typeof e)},a=function(e,n){if(!l(e))throw new TypeError(e+" is not a function");var t=r.call(arguments,2);setTimeout(function(){e.apply(n,t)})},h=function e(n){if(!(this instanceof e)||T(this))throw new TypeError(String(this)+" is not a promise");if(!l(n))throw new TypeError("Promise resolver "+String(n)+" is not a function");b(this);try{n(function(e){this._resolve(e)}.bind(this),function(e){this._reject(e)}.bind(this))}catch(e){this._reject(e)}};h.resolve=function(e){return T(e)?e:new h(function(n,t){v(e)?a(function(){try{e.then(n,t)}catch(e){t(e)}}):n(e)})},h.reject=function(e){return new h(function(n,t){t(e)})},h.race=function(e){if(void 0===e||null===e)return new h(function(e,n){a(n,void 0,TypeError("First argument of Promise.race can not be undefined or null"))});var n,r=!1;return n=Number(e.length),n=n!==n?0:n,n=(n<0?-1:1)*o(u(n)),n=f(n,0),new h(function(i,o){var u,c=0;for(u=function(e){var n,u;T(e)?g(e)?r||(r=!0,a(function(){i(e._value)})):m(e)?r||(r=!0,a(function(){o(e._reason)})):w(e)&&(n=e._resolve,u=e._reject,t(e,{_resolve:{value:function(e){n(e),r||(r=!0,i(e))}.bind(e)},_reject:{value:function(e){u(e),r||(r=!0,o(e))}.bind(e)}})):v(e)?a(function(){try{e.then(function(e){r||(r=!0,i(e))},function(e){r||(r=!0,o(e))})}catch(e){o(e)}}):r||(r=!0,a(function(){i(e)}))};c }";case"fulfilled":return"Promise { "+this._value+" }";case"rejected":return"Promise { "+this._reason+" }"}};var v=function(e){return s(e)&&l(e.then)},d=function(e){return h.resolve(e)},p=function(e){return h.reject(e)},j=function(e){E(this)||(t(this,{_state:{value:"fulfilled"},_value:{value:e}}),this._onFulfilled.length>0&&a(function(e){this._onFulfilled.forEach(function(n){n(e)}),this._onFulfilled.length=0,this._onRejected.length=0},this,e))},y=function(e){E(this)||(t(this,{_state:{value:"rejected"},_reason:{value:e}}),this._onRejected.length>0&&a(function(e){this._onRejected.forEach(function(n){n(e)}),this._onFulfilled.length=0,this._onRejected.length=0},this,e))},b=function(e){t(e,{_isPromise:{value:!0},_onFulfilled:{value:[]},_onRejected:{value:[]},_resolve:{value:j.bind(e),configurable:!0},_reject:{value:y.bind(e),configurable:!0},_state:{value:"pending",configurable:!0},_value:{value:void 0,configurable:!0},_reason:{value:void 0,configurable:!0}})},w=function(e){return"pending"===e._state},g=function(e){return"fulfilled"===e._state},m=function(e){return"rejected"===e._state},E=function(e){return"fulfilled"===e._state||"rejected"===e._state},P=function(e){return-1!==["pending","fulfilled","rejected"].indexOf(String(e))},F=function(e){return!0===e._isPromise&&i(e._onFulfilled)&&i(e._onRejected)&&l(e._resolve)&&l(e._reject)&&P(e._state)&&e.hasOwnProperty("_value")&&e.hasOwnProperty("_reason")},T=function(e){return e instanceof h&&F(e)};return t(c,{isPromise:{value:T,writable:!0,configurable:!0}}),n(e,"Promise",{value:h,writable:!0,configurable:!0}),c}); \ No newline at end of file