From 91a9f41155e6080198d1443b166d4501bb528ef2 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 7 Dec 2022 00:12:07 +0000 Subject: [PATCH] LibJS: Add spec link and comment to VM::running_execution_context() --- Userland/Libraries/LibJS/Runtime/VM.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 21a0c40806..4c5c231ef3 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -114,8 +114,12 @@ public: on_call_stack_emptied(); } + // https://tc39.es/ecma262/#running-execution-context + // At any point in time, there is at most one execution context per agent that is actually executing code. + // This is known as the agent's running execution context. ExecutionContext& running_execution_context() { return *m_execution_context_stack.last(); } ExecutionContext const& running_execution_context() const { return *m_execution_context_stack.last(); } + Vector const& execution_context_stack() const { return m_execution_context_stack; } Vector& execution_context_stack() { return m_execution_context_stack; }