Is it possible to retrieve the implementation details of a Promise instance? Let's assume the following created promise ...
let myPromise = new Promise(function (success, error) {
/* implementation */
}
Can one somehow access the anonymous function ...
function (success, error) {
/* implementation */
}
... or get the location of the anonymous function in the code file?
No. The promise object does not contain the code, neither internally nor accessible to JavaScript. A promise represents the result of a task, not the task itself, it is not runnable. The function is used only during construction.