From 56474bab1550baa691b07130bebf8156cf11b653 Mon Sep 17 00:00:00 2001 From: Barney Wilks Date: Thu, 9 Apr 2020 23:54:00 +0100 Subject: [PATCH] LibJS: Throw exception if LHS of assignment is of unexpected type --- Libraries/LibJS/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index a749d772ef..07b97edd07 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -711,7 +711,7 @@ Value AssignmentExpression::execute(Interpreter& interpreter) const object->put(property_name, rhs_result); } } else { - ASSERT_NOT_REACHED(); + return interpreter.throw_exception("ReferenceError", "Invalid left-hand side in assignment"); } return rhs_result;