Skip to content

Implement Annex B.3.9 ("Runtime Errors for Function Call Assignment Targets")#1433

Open
adams85 wants to merge 3 commits intoacornjs:masterfrom
adams85:feature/annex-b-3-9
Open

Implement Annex B.3.9 ("Runtime Errors for Function Call Assignment Targets")#1433
adams85 wants to merge 3 commits intoacornjs:masterfrom
adams85:feature/annex-b-3-9

Conversation

@adams85
Copy link
Copy Markdown
Contributor

@adams85 adams85 commented Mar 29, 2026

Implements func() = 1 Annex B.3.9 browser quirk formalized by ES2026.

Resolves #1398

@marijnh
Copy link
Copy Markdown
Member

marijnh commented Mar 29, 2026

While it is true that browser error on this in the evaluation stage rather than the parse stage, none of them actually do anything meaningful with it. What would be the practical value of implementing this quirk?

@adams85
Copy link
Copy Markdown
Contributor Author

adams85 commented Mar 29, 2026

There's zero practical value in this, it's just for standards-compliance and consistency:

  1. acorn implements the other Annex B.3 quirks like for (var x = 0 in {}) {}, try {} catch(e) { var e = null } and so on. Why should this one be an exception?
  2. Browser engines, including V8 has had this quirk for ages. As V8 is used in a lot of non-browser runtime engines like Node, those also have this quirk.
  3. The corresponding test262 cases don't need to be whitelisted.

That being said, I'm perfectly okay with scrapping this change if you say so. I just got a request for my acorn-port to implement this and backported it while I was at it.

@marijnh
Copy link
Copy Markdown
Member

marijnh commented Mar 29, 2026

@RReverser Do you have an opinion on whether this is a good idea?

@rubienterprise5667-pixel
Copy link
Copy Markdown

Hi

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.

"Runtime Errors for Function Call Assignment Targets" Test262 tests fail

3 participants