-
Notifications
You must be signed in to change notification settings - Fork 14
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
Refactoring from fetch
to XMLHttpRequest
should not break consumers of my library
#22
Comments
I believe the Web Platform should perform a |
Note in the particular case:
That sounds very reasonable. |
Yeah, it was just meant to be an off-the-cuff example; I didn't try to make it actually equivalent. That said, what's the difference you're pointing at? Only the |
Basically you got the important one:
There are a few others like:
But the important point was that we need a mechanism for hosts to specify what context a continuation runs in. |
Related: #19 |
This was discussed at some length on Matrix starting around here, but I want to capture it on this tracker so it doesn't get lost.
I think that it is not reasonable to ask every user, even those who are not using async contexts themselves, to know that
Promise.prototype.then
is a fundamentally different kind of thing than other mechanisms of scheduling callbacks, likeXMLHttpRequest.prototype.onload
.That is, if I am not myself using async contexts, I absolutely should not have to know that a normally transparent refactoring like going from
to
is in fact a breaking change, because the former preserves the context for
callback
and the latter does not.So either
Promise.prototype.then
should not automatically wrap its argument in the current context, or we should require of hosts that any mechanism for scheduling callbacks which might run in a later tick or turn should automatically wrap their argument in the current context.(Or I'm misunderstanding how this whole proposal works, which is still possible.)
The text was updated successfully, but these errors were encountered: