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[promi
|