mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 18:47:15 +02:00
LibJS: Add vector of local variables in ExecutionContext
Now ExecutionContext has vector of values that will represent values of local variables. This vector is initialized in ECMAScriptFunctionObject::internal_call() or ECMAScriptFunctionObject::internal_const() using number of local variables provided to ECMAScriptFunctionObject by the parser.
This commit is contained in:
committed by
Andreas Kling
parent
7765ebb5f2
commit
0daff637e2
Notes:
sideshowbarker
2024-07-17 09:49:33 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/0daff637e2 Pull-request: https://github.com/SerenityOS/serenity/pull/19719 Reviewed-by: https://github.com/awesomekling
@@ -149,6 +149,8 @@ ThrowCompletionOr<Value> ECMAScriptFunctionObject::internal_call(Value this_argu
|
||||
|
||||
ExecutionContext callee_context(heap());
|
||||
|
||||
callee_context.local_variables.resize(m_local_variables_names.size());
|
||||
|
||||
// Non-standard
|
||||
callee_context.arguments.extend(move(arguments_list));
|
||||
if (auto* interpreter = vm.interpreter_if_exists())
|
||||
@@ -218,6 +220,8 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ECMAScriptFunctionObject::internal_const
|
||||
|
||||
ExecutionContext callee_context(heap());
|
||||
|
||||
callee_context.local_variables.resize(m_local_variables_names.size());
|
||||
|
||||
// Non-standard
|
||||
callee_context.arguments.extend(move(arguments_list));
|
||||
if (auto* interpreter = vm.interpreter_if_exists())
|
||||
|
||||
Reference in New Issue
Block a user