Add tests for "Runtime Errors for Function Call Assignment Targets"
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:
- Correct the name of
src/assignment-target-type/callexpression-arguments.casetocallexpression.caseand mark itonlyStrict. - Add
onlyStrictcases tolanguage/expressions/assignmenttargettype/for+=,++, andfor-in/of. Also add case for&&=which applies regardless of strict or sloppy. - Add
noStrictcases toannexB/language/expressions/assignmentfor=,+=,++, andfor-in/ofwhich 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:
onlyStrictcases 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 You should have tests where the function is named async to cover the case where the cover grammar is used.
@michaelficarra Whoops, somehow missed your comment earlier. Updated now.
Ready to merge whenever is convenient to synchronize with https://github.com/tc39/ecma262/pull/3568
https://github.com/tc39/ecma262/pull/3568 has now been merged.