Can one fully implement the JavaScript Promise
class using only userspace code, without relying on any support from native code (such as the internals of JavaScript) that would typically only be accessible to those working on a JavaScript engine like the V8 team?
This question is not about creating a higher-level abstraction library or module around the existing JavaScript Promise
class (for example, to improve user-friendliness). Instead, it focuses on whether it's possible to develop an entirely new promise implementation like MyPromise
, while maintaining identical semantics to Promise
.
I attempted to find my answer by reading the relevant Promise
section in the ES6 spec, but I struggled with the complexity of the specification.