Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Make clear in the spec that the Promise constructor runs the provided function body immediately #225

Closed
SetTrend opened this issue Feb 23, 2016 · 1 comment

Comments

@SetTrend
Copy link

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.

@domenic
Copy link
Member

domenic commented Feb 23, 2016

The Promise constructor is not specced here.

@domenic domenic closed this as completed Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants