Re: Resuming execution contexts

2021-03-17 Thread Alan Schmitt
Hello,

On 2021-03-16 10:43, Logan Smyth  writes:

>> as this code does not seem to take an argument.
>
> The resumption state set by `GeneratorStart` does not take an argument
> because there is no way to access the first resumption value in a
> generator, though there is the `function.sent` proposal to allow that:
> https://github.com/tc39/proposal-function.sent
>
> In the case you're asking about, the `value` applies in the case of
> `GeneratorYield` https://tc39.es/ecma262/2021/#sec-generatoryield which
> does take a resumption value argument.

Thanks a lot for the clarification. So would it be correct to state that
resumptions are always passed a value, but in some cases it is not used
(the sentence there is "when evaluation is resumed for that execution
context") and in other cases it is used ("when evaluation is resumed
with a Completion completionName")? If so, could they be made uniform in
the specification text (for instance, "when evaluation is resumed for
that execution context with a Completion completionName")?

Thanks again,

Alan


signature.asc
Description: PGP signature
___
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss


Re: Resuming execution contexts

2021-03-16 Thread Logan Smyth
> as this code does not seem to take an argument.

The resumption state set by `GeneratorStart` does not take an argument
because there is no way to access the first resumption value in a
generator, though there is the `function.sent` proposal to allow that:
https://github.com/tc39/proposal-function.sent

In the case you're asking about, the `value` applies in the case of
`GeneratorYield` https://tc39.es/ecma262/2021/#sec-generatoryield which
does take a resumption value argument.



On Tue, Mar 16, 2021 at 2:52 AM Alan Schmitt 
wrote:

> Hello,
>
> I am trying to understand how the resuming of execution contexts work.
> For instance, step 9 of
> https://tc39.es/ecma262/2021/#sec-generatorresume says "Resume the
> suspended evaluation of genContext using NormalCompletion(value) as the
> result of the operation that suspended it." I can see that the code to
> run would be the one created by step 4 of
> https://tc39.es/ecma262/2021/#sec-generatorstart, but I do not
> understand what the "using NormalCompletion(value) as the result of the
> operation that suspended it" means, as this code does not seem to take
> an argument.
>
> Please let me know if this is not the right forum to ask such questions.
> And thanks a lot for any help you may provide.
>
> Best,
>
> Alan
> ___
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
___
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss