summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/AST.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS/AST.cpp')
-rw-r--r--Libraries/LibJS/AST.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp
index 9e7ef87923..1811e8ab84 100644
--- a/Libraries/LibJS/AST.cpp
+++ b/Libraries/LibJS/AST.cpp
@@ -941,11 +941,12 @@ Value UpdateExpression::execute(Interpreter& interpreter) const
auto reference = m_argument->to_reference(interpreter);
if (interpreter.exception())
return {};
-
auto old_value = reference.get(interpreter);
if (interpreter.exception())
return {};
- old_value = old_value.to_number();
+ old_value = old_value.to_number(interpreter);
+ if (interpreter.exception())
+ return {};
int op_result = 0;
switch (m_op) {