Is there a spec / implementation detail on how "eager" is the evaluation of the callbacks of a promise? I mean, let's say that I have
var promise = new Promise((resolve) => {
resolve()
});
console.log(promise); // there is no public field '<state>', but you can see it in the console of the dev tools
I see that promise
is already fulfilled; I was expecting that the Promise
internal implementation would call the resolve
callback on an following time, leaving a "time window" with promise
still unfulfilled.
Is this "eager" evaluation of the resolve
callback "by design"? Is this just an implementation detail?