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

Add info about non-interference of handlers #74

Closed
briancavalier opened this issue Feb 11, 2013 · 9 comments
Closed

Add info about non-interference of handlers #74

briancavalier opened this issue Feb 11, 2013 · 9 comments

Comments

@briancavalier
Copy link
Member

I had a twitter convo today with someone who couldn't tell from the current spec whether one handler could prevent another from being executed. For example, he was unsure if f2 would be executed in this scenario:

// let p1 be a fulfilled promise
p1.then(function f1() { throw new Error(); });
p1.then(function f2() {});

My feeling is that 3.2.2, 3.2.3, and 3.2.5.x are sufficient, and I pointed him to those. He still felt it wasn't obvious, so I wanted to pass along his concern to see whether others feel we should add something to clarify.

@avoidwork
Copy link

Hi,

I'm that someone, and I just wanted to add a little context. The rule is implicit; it really only comes across if you think of the problem a certain way, otherwise it becomes a question. If you defined the rule explicitly, there'd be no question during implementation, e.g. Errors thrown from a handler will not block execution of subsequent handlers

Of course, the issue could be I just looked at the problem another way and missed the implication. Regardless, if it's open to interpretation there's room for error. Adding another point at the right place would help greatly.

@briancavalier
Copy link
Member Author

@avoidwork Thanks for the additional context! Were you coming at this as a user of promises, or as an implementer of promises (or both)?

@avoidwork
Copy link

A little of both. I'm writing the tool set (implementer) which I build on of (user). No one I work with has experience with the pattern beyond jQuery's version, and ... yeah.

@lsmith
Copy link
Contributor

lsmith commented Feb 11, 2013

@avoidwork Would the insertion of the word "all" into 3.2.5.1 and .2 clarify enough?

If/when promise is fulfilled, all respective onFulfilled callbacks must execute in the order of their originating calls to then.

@avoidwork
Copy link

yup

@domenic
Copy link
Member

domenic commented Feb 11, 2013

Let's do that then, it's very easy and doesn't seem like it's overburdening the spec with non-normative language.

@briancavalier
Copy link
Member Author

Sounds good to me as well. Since it doesn't seem to make the spec any less clear, and in fact, makes it more clear for at least one person, it seems like a good thing :)

@briancavalier
Copy link
Member Author

I can do this when I get back to a keyboard in a bit if no one gets to it first.

briancavalier added a commit to briancavalier/promises-spec that referenced this issue Feb 12, 2013
@briancavalier
Copy link
Member Author

Oops sorry for the double commit messages above. One is from my fork, but I decided just to make this change directly, as it seemed silly to pull request it since it was such a small change.

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

4 participants