1 line
9.1 KiB
JSON
1 line
9.1 KiB
JSON
{"ast":null,"code":"'use strict';\n\nvar Promise = require('./core');\n\nvar DEFAULT_WHITELIST = [ReferenceError, TypeError, RangeError];\nvar enabled = false;\nexports.disable = disable;\n\nfunction disable() {\n enabled = false;\n Promise._Y = null;\n Promise._Z = null;\n}\n\nexports.enable = enable;\n\nfunction enable(options) {\n options = options || {};\n if (enabled) disable();\n enabled = true;\n var id = 0;\n var displayId = 0;\n var rejections = {};\n\n Promise._Y = function (promise) {\n if (promise._V === 2 && // IS REJECTED\n rejections[promise._1]) {\n if (rejections[promise._1].logged) {\n onHandled(promise._1);\n } else {\n clearTimeout(rejections[promise._1].timeout);\n }\n\n delete rejections[promise._1];\n }\n };\n\n Promise._Z = function (promise, err) {\n if (promise._U === 0) {\n // not yet handled\n promise._1 = id++;\n rejections[promise._1] = {\n displayId: null,\n error: err,\n timeout: setTimeout(onUnhandled.bind(null, promise._1), // For reference errors and type errors, this almost always\n // means the programmer made a mistake, so log them after just\n // 100ms\n // otherwise, wait 2 seconds to see if they get handled\n matchWhitelist(err, DEFAULT_WHITELIST) ? 100 : 2000),\n logged: false\n };\n }\n };\n\n function onUnhandled(id) {\n if (options.allRejections || matchWhitelist(rejections[id].error, options.whitelist || DEFAULT_WHITELIST)) {\n rejections[id].displayId = displayId++;\n\n if (options.onUnhandled) {\n rejections[id].logged = true;\n options.onUnhandled(rejections[id].displayId, rejections[id].error);\n } else {\n rejections[id].logged = true;\n logError(rejections[id].displayId, rejections[id].error);\n }\n }\n }\n\n function onHandled(id) {\n if (rejections[id].logged) {\n if (options.onHandled) {\n options.onHandled(rejections[id].displayId, rejections[id].error);\n } else if (!rejections[id].onUnhandled) {\n console.warn('Promise Rejection Handled (id: ' + rejections[id].displayId + '):');\n console.warn(' This means you can ignore any previous messages of the form \"Possible Unhandled Promise Rejection\" with id ' + rejections[id].displayId + '.');\n }\n }\n }\n}\n\nfunction logError(id, error) {\n console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):');\n var errStr = (error && (error.stack || error)) + '';\n errStr.split('\\n').forEach(function (line) {\n console.warn(' ' + line);\n });\n}\n\nfunction matchWhitelist(error, list) {\n return list.some(function (cls) {\n return error instanceof cls;\n });\n}","map":{"version":3,"names":["Promise","require","DEFAULT_WHITELIST","ReferenceError","TypeError","RangeError","enabled","exports","disable","_Y","_Z","enable","options","id","displayId","rejections","promise","_V","_1","logged","onHandled","clearTimeout","timeout","err","_U","error","setTimeout","onUnhandled","bind","matchWhitelist","allRejections","whitelist","logError","console","warn","errStr","stack","split","forEach","line","list","some","cls"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/promise/lib/rejection-tracking.js"],"sourcesContent":["'use strict';\n\nvar Promise = require('./core');\n\nvar DEFAULT_WHITELIST = [\n ReferenceError,\n TypeError,\n RangeError\n];\n\nvar enabled = false;\nexports.disable = disable;\nfunction disable() {\n enabled = false;\n Promise._Y = null;\n Promise._Z = null;\n}\n\nexports.enable = enable;\nfunction enable(options) {\n options = options || {};\n if (enabled) disable();\n enabled = true;\n var id = 0;\n var displayId = 0;\n var rejections = {};\n Promise._Y = function (promise) {\n if (\n promise._V === 2 && // IS REJECTED\n rejections[promise._1]\n ) {\n if (rejections[promise._1].logged) {\n onHandled(promise._1);\n } else {\n clearTimeout(rejections[promise._1].timeout);\n }\n delete rejections[promise._1];\n }\n };\n Promise._Z = function (promise, err) {\n if (promise._U === 0) { // not yet handled\n promise._1 = id++;\n rejections[promise._1] = {\n displayId: null,\n error: err,\n timeout: setTimeout(\n onUnhandled.bind(null, promise._1),\n // For reference errors and type errors, this almost always\n // means the programmer made a mistake, so log them after just\n // 100ms\n // otherwise, wait 2 seconds to see if they get handled\n matchWhitelist(err, DEFAULT_WHITELIST)\n ? 100\n : 2000\n ),\n logged: false\n };\n }\n };\n function onUnhandled(id) {\n if (\n options.allRejections ||\n matchWhitelist(\n rejections[id].error,\n options.whitelist || DEFAULT_WHITELIST\n )\n ) {\n rejections[id].displayId = displayId++;\n if (options.onUnhandled) {\n rejections[id].logged = true;\n options.onUnhandled(\n rejections[id].displayId,\n rejections[id].error\n );\n } else {\n rejections[id].logged = true;\n logError(\n rejections[id].displayId,\n rejections[id].error\n );\n }\n }\n }\n function onHandled(id) {\n if (rejections[id].logged) {\n if (options.onHandled) {\n options.onHandled(rejections[id].displayId, rejections[id].error);\n } else if (!rejections[id].onUnhandled) {\n console.warn(\n 'Promise Rejection Handled (id: ' + rejections[id].displayId + '):'\n );\n console.warn(\n ' This means you can ignore any previous messages of the form \"Possible Unhandled Promise Rejection\" with id ' +\n rejections[id].displayId + '.'\n );\n }\n }\n }\n}\n\nfunction logError(id, error) {\n console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):');\n var errStr = (error && (error.stack || error)) + '';\n errStr.split('\\n').forEach(function (line) {\n console.warn(' ' + line);\n });\n}\n\nfunction matchWhitelist(error, list) {\n return list.some(function (cls) {\n return error instanceof cls;\n });\n}"],"mappings":"AAAA;;AAEA,IAAIA,OAAO,GAAGC,OAAO,CAAC,QAAD,CAArB;;AAEA,IAAIC,iBAAiB,GAAG,CACtBC,cADsB,EAEtBC,SAFsB,EAGtBC,UAHsB,CAAxB;AAMA,IAAIC,OAAO,GAAG,KAAd;AACAC,OAAO,CAACC,OAAR,GAAkBA,OAAlB;;AACA,SAASA,OAAT,GAAmB;EACjBF,OAAO,GAAG,KAAV;EACAN,OAAO,CAACS,EAAR,GAAa,IAAb;EACAT,OAAO,CAACU,EAAR,GAAa,IAAb;AACD;;AAEDH,OAAO,CAACI,MAAR,GAAiBA,MAAjB;;AACA,SAASA,MAAT,CAAgBC,OAAhB,EAAyB;EACvBA,OAAO,GAAGA,OAAO,IAAI,EAArB;EACA,IAAIN,OAAJ,EAAaE,OAAO;EACpBF,OAAO,GAAG,IAAV;EACA,IAAIO,EAAE,GAAG,CAAT;EACA,IAAIC,SAAS,GAAG,CAAhB;EACA,IAAIC,UAAU,GAAG,EAAjB;;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