I often feel confused by the fact that the Promise constructor automatically launches the executor function with the next event loop (e.g. by executing process.nextTick()).
The fact that constructing a Promise object is synonymous to "immediately" running the Promise's function body doesn't seem natural to me. The fact that this happens only becomes clear by lack of such a thing like a Promise(...).Start() method.
I believe it should be made clear in the specification that constructing a Promise object automatically runs the Promise's code immediately with the next event loop.
I often feel confused by the fact that the
Promise
constructor automatically launches the executor function with the next event loop (e.g. by executingprocess.nextTick()
).The fact that constructing a
Promise
object is synonymous to "immediately" running the Promise's function body doesn't seem natural to me. The fact that this happens only becomes clear by lack of such a thing like aPromise(...).Start()
method.I believe it should be made clear in the specification that constructing a
Promise
object automatically runs the Promise's code immediately with the next event loop.