test262 icon indicating copy to clipboard operation
test262 copied to clipboard

Add tests for "Runtime Errors for Function Call Assignment Targets"

Open rkirsling opened this issue 6 months ago • 3 comments

Add tests for normative PR https://github.com/tc39/ecma262/pull/3568, which adds Annex B section, "Runtime 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.

  • V8: onlyStrict cases fail
  • SM: "its return value is not resolved to a primitive" fails for ++ (but += is OK)
  • JSC: ~~"the function is called" is never true~~ (WebKit/WebKit#44364)

rkirsling avatar Apr 21 '25 05:04 rkirsling