Is the Javascript Promise
class something one could implement fully in userspace code, without requiring any support from native code (i.e., the Javascript internals) that only someone implementing a Javascript engine (such as the V8 team) would have access to?
Note that I'm not talking about implementing a higher-level abstraction library or module around the existing Javascript Promise
class (say, to make it user-friendlier); rather, I'm talking about an entirely new, replacement promise implementation, say, MyPromise
, with identical semantics as Promise
.
I tried reading the relevant Promise
section in the ES6 spec to get my answer, but found the spec very hard to read.
Is the JavaScript Promise class something one could implement fully in userspace code, without requiring any support from native code?
Yes.
The prime example is Bluebird.