LibJS: Throw exception if LHS of assignment is of unexpected type

This commit is contained in:
Barney Wilks 2020-04-09 23:54:00 +01:00 committed by Andreas Kling
commit 56474bab15
Notes: sideshowbarker 2024-07-19 07:45:23 +09:00

View file

@ -711,7 +711,7 @@ Value AssignmentExpression::execute(Interpreter& interpreter) const
object->put(property_name, rhs_result);
}
} else {
ASSERT_NOT_REACHED();
return interpreter.throw_exception<Error>("ReferenceError", "Invalid left-hand side in assignment");
}
return rhs_result;