1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibJS: Validate all assignment expressions, not just "="

The check for invalid lhs and assignment to eval/arguments in strict
mode should happen for all kinds of assignment expressions, not just
AssignmentOp::Assignment.
This commit is contained in:
Linus Groh 2020-10-04 23:58:57 +01:00 committed by Andreas Kling
parent e80217a746
commit 283ee678f7
3 changed files with 56 additions and 39 deletions

View file

@ -84,6 +84,7 @@ public:
NonnullRefPtr<ClassDeclaration> parse_class_declaration();
NonnullRefPtr<ClassExpression> parse_class_expression(bool expect_class_name);
NonnullRefPtr<Expression> parse_property_key();
NonnullRefPtr<AssignmentExpression> parse_assignment_expression(AssignmentOp, NonnullRefPtr<Expression> lhs, int min_precedence, Associativity);
struct Error {
String message;