1 line
16 KiB
JSON
1 line
16 KiB
JSON
{"ast":null,"code":"'use strict';\n\nvar asap = require('asap/raw');\n\nfunction noop() {} // States:\n//\n// 0 - pending\n// 1 - fulfilled with _value\n// 2 - rejected with _value\n// 3 - adopted the state of another promise, _value\n//\n// once the state is no longer pending (0) it is immutable\n// All `_` prefixed properties will be reduced to `_{random number}`\n// at build time to obfuscate them and discourage their use.\n// We don't use symbols or Object.defineProperty to fully hide them\n// because the performance isn't good enough.\n// to avoid using try/catch inside critical functions, we\n// extract them to here.\n\n\nvar LAST_ERROR = null;\nvar IS_ERROR = {};\n\nfunction getThen(obj) {\n try {\n return obj.then;\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\n\nfunction tryCallOne(fn, a) {\n try {\n return fn(a);\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\n\nfunction tryCallTwo(fn, a, b) {\n try {\n fn(a, b);\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\n\nmodule.exports = Promise;\n\nfunction Promise(fn) {\n if (typeof this !== 'object') {\n throw new TypeError('Promises must be constructed via new');\n }\n\n if (typeof fn !== 'function') {\n throw new TypeError('Promise constructor\\'s argument is not a function');\n }\n\n this._U = 0;\n this._V = 0;\n this._W = null;\n this._X = null;\n if (fn === noop) return;\n doResolve(fn, this);\n}\n\nPromise._Y = null;\nPromise._Z = null;\nPromise._0 = noop;\n\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (this.constructor !== Promise) {\n return safeThen(this, onFulfilled, onRejected);\n }\n\n var res = new Promise(noop);\n handle(this, new Handler(onFulfilled, onRejected, res));\n return res;\n};\n\nfunction safeThen(self, onFulfilled, onRejected) {\n return new self.constructor(function (resolve, reject) {\n var res = new Promise(noop);\n res.then(resolve, reject);\n handle(self, new Handler(onFulfilled, onRejected, res));\n });\n}\n\nfunction handle(self, deferred) {\n while (self._V === 3) {\n self = self._W;\n }\n\n if (Promise._Y) {\n Promise._Y(self);\n }\n\n if (self._V === 0) {\n if (self._U === 0) {\n self._U = 1;\n self._X = deferred;\n return;\n }\n\n if (self._U === 1) {\n self._U = 2;\n self._X = [self._X, deferred];\n return;\n }\n\n self._X.push(deferred);\n\n return;\n }\n\n handleResolved(self, deferred);\n}\n\nfunction handleResolved(self, deferred) {\n asap(function () {\n var cb = self._V === 1 ? deferred.onFulfilled : deferred.onRejected;\n\n if (cb === null) {\n if (self._V === 1) {\n resolve(deferred.promise, self._W);\n } else {\n reject(deferred.promise, self._W);\n }\n\n return;\n }\n\n var ret = tryCallOne(cb, self._W);\n\n if (ret === IS_ERROR) {\n reject(deferred.promise, LAST_ERROR);\n } else {\n resolve(deferred.promise, ret);\n }\n });\n}\n\nfunction resolve(self, newValue) {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self) {\n return reject(self, new TypeError('A promise cannot be resolved with itself.'));\n }\n\n if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {\n var then = getThen(newValue);\n\n if (then === IS_ERROR) {\n return reject(self, LAST_ERROR);\n }\n\n if (then === self.then && newValue instanceof Promise) {\n self._V = 3;\n self._W = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(then.bind(newValue), self);\n return;\n }\n }\n\n self._V = 1;\n self._W = newValue;\n finale(self);\n}\n\nfunction reject(self, newValue) {\n self._V = 2;\n self._W = newValue;\n\n if (Promise._Z) {\n Promise._Z(self, newValue);\n }\n\n finale(self);\n}\n\nfunction finale(self) {\n if (self._U === 1) {\n handle(self, self._X);\n self._X = null;\n }\n\n if (self._U === 2) {\n for (var i = 0; i < self._X.length; i++) {\n handle(self, self._X[i]);\n }\n\n self._X = null;\n }\n}\n\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\n\n\nfunction doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}","map":{"version":3,"names":["asap","require","noop","LAST_ERROR","IS_ERROR","getThen","obj","then","ex","tryCallOne","fn","a","tryCallTwo","b","module","exports","Promise","TypeError","_U","_V","_W","_X","doResolve","_Y","_Z","_0","prototype","onFulfilled","onRejected","constructor","safeThen","res","handle","Handler","self","resolve","reject","deferred","push","handleResolved","cb","promise","ret","newValue","finale","bind","i","length","done","value","reason"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/promise/lib/core.js"],"sourcesContent":["'use strict';\n\nvar asap = require('asap/raw');\n\nfunction noop() {}\n\n// States:\n//\n// 0 - pending\n// 1 - fulfilled with _value\n// 2 - rejected with _value\n// 3 - adopted the state of another promise, _value\n//\n// once the state is no longer pending (0) it is immutable\n\n// All `_` prefixed properties will be reduced to `_{random number}`\n// at build time to obfuscate them and discourage their use.\n// We don't use symbols or Object.defineProperty to fully hide them\n// because the performance isn't good enough.\n\n\n// to avoid using try/catch inside critical functions, we\n// extract them to here.\nvar LAST_ERROR = null;\nvar IS_ERROR = {};\nfunction getThen(obj) {\n try {\n return obj.then;\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\n\nfunction tryCallOne(fn, a) {\n try {\n return fn(a);\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\nfunction tryCallTwo(fn, a, b) {\n try {\n fn(a, b);\n } catch (ex) {\n LAST_ERROR = ex;\n return IS_ERROR;\n }\n}\n\nmodule.exports = Promise;\n\nfunction Promise(fn) {\n if (typeof this !== 'object') {\n throw new TypeError('Promises must be constructed via new');\n }\n if (typeof fn !== 'function') {\n throw new TypeError('Promise constructor\\'s argument is not a function');\n }\n this._U = 0;\n this._V = 0;\n this._W = null;\n this._X = null;\n if (fn === noop) return;\n doResolve(fn, this);\n}\nPromise._Y = null;\nPromise._Z = null;\nPromise._0 = noop;\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n if (this.constructor !== Promise) {\n return safeThen(this, onFulfilled, onRejected);\n }\n var res = new Promise(noop);\n handle(this, new Handler(onFulfilled, onRejected, res));\n return res;\n};\n\nfunction safeThen(self, onFulfilled, onRejected) {\n return new self.constructor(function (resolve, reject) {\n var res = new Promise(noop);\n res.then(resolve, reject);\n handle(self, new Handler(onFulfilled, onRejected, res));\n });\n}\nfunction handle(self, deferred) {\n while (self._V === 3) {\n self = self._W;\n }\n if (Promise._Y) {\n Promise._Y(self);\n }\n if (self._V === 0) {\n if (self._U === 0) {\n self._U = 1;\n self._X = deferred;\n return;\n }\n if (self._U === 1) {\n self._U = 2;\n self._X = [self._X, deferred];\n return;\n }\n self._X.push(deferred);\n return;\n }\n handleResolved(self, deferred);\n}\n\nfunction handleResolved(self, deferred) {\n asap(function() {\n var cb = self._V === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n if (self._V === 1) {\n resolve(deferred.promise, self._W);\n } else {\n reject(deferred.promise, self._W);\n }\n return;\n }\n var ret = tryCallOne(cb, self._W);\n if (ret === IS_ERROR) {\n reject(deferred.promise, LAST_ERROR);\n } else {\n resolve(deferred.promise, ret);\n }\n });\n}\nfunction resolve(self, newValue) {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self) {\n return reject(\n self,\n new TypeError('A promise cannot be resolved with itself.')\n );\n }\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = getThen(newValue);\n if (then === IS_ERROR) {\n return reject(self, LAST_ERROR);\n }\n if (\n then === self.then &&\n newValue instanceof Promise\n ) {\n self._V = 3;\n self._W = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(then.bind(newValue), self);\n return;\n }\n }\n self._V = 1;\n self._W = newValue;\n finale(self);\n}\n\nfunction reject(self, newValue) {\n self._V = 2;\n self._W = newValue;\n if (Promise._Z) {\n Promise._Z(self, newValue);\n }\n finale(self);\n}\nfunction finale(self) {\n if (self._U === 1) {\n handle(self, self._X);\n self._X = null;\n }\n if (self._U === 2) {\n for (var i = 0; i < self._X.length; i++) {\n handle(self, self._X[i]);\n }\n self._X = null;\n }\n}\n\nfunction Handler(onFulfilled, onRejected, promise){\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, promise) {\n var done = false;\n var res = tryCallTwo(fn, function (value) {\n if (done) return;\n done = true;\n resolve(promise, value);\n }, function (reason) {\n if (done) return;\n done = true;\n reject(promise, reason);\n });\n if (!done && res === IS_ERROR) {\n done = true;\n reject(promise, LAST_ERROR);\n }\n}\n"],"mappings":"AAAA;;AAEA,IAAIA,IAAI,GAAGC,OAAO,CAAC,UAAD,CAAlB;;AAEA,SAASC,IAAT,GAAgB,CAAE,C,CAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;;;AACA,IAAIC,UAAU,GAAG,IAAjB;AACA,IAAIC,QAAQ,GAAG,EAAf;;AACA,SAASC,OAAT,CAAiBC,GAAjB,EAAsB;EACpB,IAAI;IACF,OAAOA,GAAG,CAACC,IAAX;EACD,CAFD,CAEE,OAAOC,EAAP,EAAW;IACXL,UAAU,GAAGK,EAAb;IACA,OAAOJ,QAAP;EACD;AACF;;AAED,SAASK,UAAT,CAAoBC,EAApB,EAAwBC,CAAxB,EAA2B;EACzB,IAAI;IACF,OAAO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