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.
This commit is contained in:
Andreas Kling 2025-04-04 18:53:10 +02:00
commit 76146141fc

View file

@ -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);
}