Re: [promises] resolver's resolved flag check on promise callback
Anne van Kesteren <[email protected]>
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <CADnb78i7E=CDdWb4wMbfLfsHwVnNcW3RUv6cpVG=9NFVKVbHzA@mail.gmail.com> |
On Thu, Jun 27, 2013 at 2:51 AM, Yutaka Hirano <[email protected]> wrote: > Hi, I am implementing promises and I have a question. > In resolve algorithm, we create promise callbacks for the given resolver and > pass them to a (possibly) user defined function. > A user can call them more than once. > Since a promise callback for |resolver| and |algorithm| runs |resolver|'s > |algorithm| and the |algorithm| doesn't checks |resolver|'s resolved flag, > it seems that the promise can be resolved or rejected multiple times. > Is it correct? I think the check for the resolved flag is needed in: > - promise callback > - 4.4 in resolve algorithm. What do you mean by 4.4? I think you're right that this is problematic, but it's not entirely clear to me this solves it. -- http://annevankesteren.nl/