From 88b15b08190805bb904577f3f0689ae150b62c7a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 9 Nov 2022 15:22:12 +0100 Subject: [PATCH] LibJS: Move throw_completion(Value) out of line This allows us to instrument this function locally without rebuilding 1000+ files. --- Userland/Libraries/LibJS/Runtime/Completion.cpp | 6 ++++++ Userland/Libraries/LibJS/Runtime/Completion.h | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Completion.cpp b/Userland/Libraries/LibJS/Runtime/Completion.cpp index ebd4852178..f09ac80125 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.cpp +++ b/Userland/Libraries/LibJS/Runtime/Completion.cpp @@ -120,4 +120,10 @@ ThrowCompletionOr await(VM& vm, Value value) return throw_completion(result); } +// 6.2.3.3 ThrowCompletion ( value ), https://tc39.es/ecma262/#sec-throwcompletion +Completion throw_completion(Value value) +{ + return { Completion::Type::Throw, value, {} }; +} + } diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index abc90d64ec..06baf92914 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -302,9 +302,6 @@ inline Completion normal_completion(Optional value) } // 6.2.3.3 ThrowCompletion ( value ), https://tc39.es/ecma262/#sec-throwcompletion -inline Completion throw_completion(Value value) -{ - return { Completion::Type::Throw, value, {} }; -} +Completion throw_completion(Value); }