mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
LibJS: Allow CallExpression as left hand side of for-of/for-in loops
Although this will fail with a ReferenceError it should pass the parser and only fail if actually assigned to.
This commit is contained in:
parent
ce057115fc
commit
65bebb5241
4 changed files with 63 additions and 10 deletions
|
@ -865,7 +865,7 @@ struct ForInOfHeadState {
|
|||
VERIFY(declaration.declarations().first().target().has<NonnullRefPtr<Identifier>>());
|
||||
lhs_reference = TRY(declaration.declarations().first().target().get<NonnullRefPtr<Identifier>>()->to_reference(interpreter, global_object));
|
||||
} else {
|
||||
VERIFY(is<Identifier>(*expression_lhs) || is<MemberExpression>(*expression_lhs));
|
||||
VERIFY(is<Identifier>(*expression_lhs) || is<MemberExpression>(*expression_lhs) || is<CallExpression>(*expression_lhs));
|
||||
auto& expression = static_cast<Expression const&>(*expression_lhs);
|
||||
lhs_reference = TRY(expression.to_reference(interpreter, global_object));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue