summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Completion.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-02-10 11:36:03 -0500
committerLinus Groh <mail@linusgroh.de>2023-02-10 17:26:20 +0000
commit8f9659a5495e598dec542b529efd90ca4d737c60 (patch)
treeff12661d994a726365951ee14f31bdaa58795b3b /Userland/Libraries/LibJS/Runtime/Completion.h
parent519a1cd23ddb2b87810a9e87b1a3a00c8155f371 (diff)
downloadserenity-8f9659a5495e598dec542b529efd90ca4d737c60.zip
LibJS: Surround the VM parameter of TRY_OR_THROW_OOM with parentheses
Depending on how this is invoked, the preprocessor may get confused when pasting the VM parameter into this expression. For example, it trips up on the JS REPL in cases such as: TRY_OR_THROW_OOM(*g_vm, ...);
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Completion.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Completion.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h
index 7fe307bf01..b5d089ab84 100644
--- a/Userland/Libraries/LibJS/Runtime/Completion.h
+++ b/Userland/Libraries/LibJS/Runtime/Completion.h
@@ -24,7 +24,7 @@ namespace JS {
auto&& _temporary_result = (expression)); \
if (_temporary_result.is_error()) { \
VERIFY(_temporary_result.error().code() == ENOMEM); \
- return vm.throw_completion<JS::InternalError>(JS::ErrorType::OutOfMemory); \
+ return (vm).throw_completion<JS::InternalError>(JS::ErrorType::OutOfMemory); \
} \
static_assert(!::AK::Detail::IsLvalueReference<decltype(_temporary_result.release_value())>, \
"Do not return a reference from a fallible expression"); \