Skip to content

Conversation

nicolo-ribaudo
Copy link
Member

Minor drive-by change. While reading https://tc39.es/ecma262/#sec-generator-function-definitions-runtime-semantics-evaluation, I noticed that in yield * we were re-using the same _value_ variable for three unrelated things:

  • the value of the AssignmentExpression in yield* AssignmentExpression
  • the argument passed to the generator's .return()
  • the return value of the inner iterator's .return()

I was originally a bit surprised to see that the value of the AssignmentExpression was still used in the algorithm after getting the iterator record out of it (which isn't actually, it's just the variable).

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

Successfully merging this pull request may close these issues.

1 participant