Annex B sec-runtime-errors-for-function-call-assignment-targets requires that CallExpression as an assignment LHS in non-strict code is valid syntax that throws ReferenceError at runtime. Boa rejects it at parse time.
Repro (non-strict):
function f() { return {}; }
function g() { return 1; }
f() = g(); // should throw ReferenceError at runtime
f() += 1;
++f();
f()++;
for (f() in []) {}
Expected: ReferenceError at runtime
Got: SyntaxError: Invalid left-hand side in assignment at parse time
Spec: https://tc39.es/ecma262/#sec-runtime-errors-for-function-call-assignment-targets
Fix: In the parser, when the LHS of an assignment is a CallExpression in non-strict mode, accept the syntax and emit a runtime ReferenceError instead of a parse error.
Failing test262: annexB/language/expressions/assignmenttargettype/ (7 cases)
Annex B
sec-runtime-errors-for-function-call-assignment-targetsrequires that CallExpression as an assignment LHS in non-strict code is valid syntax that throwsReferenceErrorat runtime. Boa rejects it at parse time.Repro (non-strict):
Expected:
ReferenceErrorat runtimeGot:
SyntaxError: Invalid left-hand side in assignmentat parse timeSpec: https://tc39.es/ecma262/#sec-runtime-errors-for-function-call-assignment-targets
Fix: In the parser, when the LHS of an assignment is a CallExpression in non-strict mode, accept the syntax and emit a runtime
ReferenceErrorinstead of a parse error.Failing test262:
annexB/language/expressions/assignmenttargettype/(7 cases)