W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2013

Re: [promises] resolver's resolved flag check on promise callback

From: Anne van Kesteren <annevk@annevk.nl>
Date: Fri, 28 Jun 2013 14:53:20 +0100
Message-ID: <CADnb78i7E=CDdWb4wMbfLfsHwVnNcW3RUv6cpVG=9NFVKVbHzA@mail.gmail.com>
To: Yutaka Hirano <yhirano@chromium.org>
Cc: www-dom@w3c.org
On Thu, Jun 27, 2013 at 2:51 AM, Yutaka Hirano <yhirano@chromium.org> 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.

Received on Friday, 28 June 2013 13:53:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:02 UTC