From 0d913637428deffd5411f09512d2f0c518f547e5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 4 Apr 2025 18:53:10 +0200 Subject: [PATCH] LibJS: Remove weird fallback behavior in VM::argument/argument_count If there's no running execution context, let's just error out in there instead of returning a weird empty value. --- Libraries/LibJS/Runtime/VM.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Libraries/LibJS/Runtime/VM.h b/Libraries/LibJS/Runtime/VM.h index 32c4bae46c5..ac4d10b7f8a 100644 --- a/Libraries/LibJS/Runtime/VM.h +++ b/Libraries/LibJS/Runtime/VM.h @@ -165,15 +165,11 @@ public: size_t argument_count() const { - if (m_execution_context_stack.is_empty()) - return 0; return running_execution_context().arguments.size(); } Value argument(size_t index) const { - if (m_execution_context_stack.is_empty()) - return {}; return running_execution_context().argument(index); }