diff options
author | Linus Groh <mail@linusgroh.de> | 2021-12-28 17:57:09 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-01-03 21:50:50 +0100 |
commit | 95acb1ce885b2d2b833e6f4e3b12dfd41b50bc80 (patch) | |
tree | ecb732c41a50d7dbcc0635f66b86d78a03dbaffe /Userland/Libraries/LibJS/AST.cpp | |
parent | 032e6a2d281008919ef8efd52c0d7b9d1784e60f (diff) | |
download | serenity-95acb1ce885b2d2b833e6f4e3b12dfd41b50bc80.zip |
LibJS: Don't assume non-empty [[Value]] in Completion TRY() helpers
Diffstat (limited to 'Userland/Libraries/LibJS/AST.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/AST.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index a98c7e5674..4da5201576 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -888,7 +888,7 @@ Value ForOfStatement::execute(Interpreter& interpreter, GlobalObject& global_obj interpreter.vm().running_execution_context().lexical_environment = old_environment; }); - TRY_OR_DISCARD(get_iterator_values(global_object, rhs_result, [&](Value value) -> Optional<Completion> { + (void)TRY_OR_DISCARD(get_iterator_values(global_object, rhs_result, [&](Value value) -> Optional<Completion> { TRY(for_of_head_state.execute_head(interpreter, global_object, value)); last_value = m_body->execute(interpreter, global_object).value_or(last_value); interpreter.vm().running_execution_context().lexical_environment = old_environment; @@ -2973,7 +2973,7 @@ Value ArrayExpression::execute(Interpreter& interpreter, GlobalObject& global_ob return {}; if (is<SpreadExpression>(*element)) { - TRY_OR_DISCARD(get_iterator_values(global_object, value, [&](Value iterator_value) -> Optional<Completion> { + (void)TRY_OR_DISCARD(get_iterator_values(global_object, value, [&](Value iterator_value) -> Optional<Completion> { array->indexed_properties().put(index++, iterator_value, default_attributes); return {}; })); |