Skip to content

Add tests for "Late Errors for Function Call Assignment Targets" #4459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rkirsling
Copy link
Member

@rkirsling rkirsling commented Apr 21, 2025

Add tests for normative PR tc39/ecma262#3568, which adds Annex B section, "Late Errors for Function Call Assignment Targets".

Specifically:

  1. Correct the name of src/assignment-target-type/callexpression-arguments.case to callexpression.case and mark it onlyStrict.
  2. Add onlyStrict cases to language/expressions/assignmenttargettype/ for +=, ++, and for-in/of. Also add case for &&= which applies regardless of strict or sloppy.
  3. Add noStrict cases to annexB/language/expressions/assignment for =, +=, ++, and for-in/of which check that:
    • a ReferenceError is thrown
    • the function is called, but its return value is not resolved to a primitive
    • (= and += only) the RHS is not evaluated

Note: All hosts have some work to do.

@rkirsling rkirsling requested a review from a team as a code owner April 21, 2025 05:11
@rkirsling rkirsling changed the title Add tests for ecma262#3568 Add tests for "Late Errors for Function Call Assignment Targets" Apr 21, 2025
@ptomato ptomato added needs review awaiting consensus This needs committee consensus before it can be eligible to be merged. labels Apr 23, 2025
@michaelficarra
Copy link
Member

@rkirsling You should have tests where the function is named async to cover the case where the cover grammar is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting consensus This needs committee consensus before it can be eligible to be merged. needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants