Skip to content

Normative: add missing AsyncGenerator cases to ContainsArguments#2505

Merged
ljharb merged 2 commits intomasterfrom
contains-arguments-async-generator
Sep 16, 2021
Merged

Normative: add missing AsyncGenerator cases to ContainsArguments#2505
ljharb merged 2 commits intomasterfrom
contains-arguments-async-generator

Conversation

@bakkot
Copy link
Copy Markdown
Member

@bakkot bakkot commented Aug 29, 2021

ContainsArguments, added in #1668, is used to forbid class field initializers which refer to the outer arguments binding. It's not intended to descend into non-arrow functions, since those introduce their own binding for arguments, which is fine. Unfortunately it was accidentally missing the AsyncGenerator cases, meaning that, as written, (class { x = async function*(){ arguments } }) was an Early Error, unlike (class { x = function*(){ arguments } }) or (class { x = async function(){ arguments } }).

Engine262 actually implements the specified behavior, but no other engine I tested did.

This is technically normative, because the current semantics are coherent, but I think we need not seek consensus for it - it was definitely just an oversight.

The first commit is just a reorganization of the SDO to make it easier to read. I suggest reviewing (and landing) the commits separately.

@bakkot bakkot added normative change Affects behavior required to correctly evaluate some ECMAScript source text spec bug labels Aug 29, 2021
@bakkot bakkot force-pushed the contains-arguments-async-generator branch from afa799e to 59aaf8a Compare August 29, 2021 03:00
@michaelficarra michaelficarra added the needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 label Aug 30, 2021
@bakkot
Copy link
Copy Markdown
Member Author

bakkot commented Aug 30, 2021

I disagree with the needs tests label, since this is just a bugfix. @syg thoughts?

@liannemarie

This comment has been minimized.

@bakkot bakkot added the editor call to be discussed in the next editor call label Sep 8, 2021
@bakkot bakkot added ready to merge Editors believe this PR needs no further reviews, and is ready to land. and removed needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 editor call to be discussed in the next editor call labels Sep 15, 2021
@ljharb ljharb force-pushed the contains-arguments-async-generator branch from 59aaf8a to 2e131c2 Compare September 16, 2021 05:23
@ljharb ljharb merged commit 2e131c2 into master Sep 16, 2021
@ljharb ljharb deleted the contains-arguments-async-generator branch September 16, 2021 05:26
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

normative change Affects behavior required to correctly evaluate some ECMAScript source text ready to merge Editors believe this PR needs no further reviews, and is ready to land. spec bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants