mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibJS: Only assign initial "accumulator" value if actually provided
This commit is contained in:
parent
6f9d297c3c
commit
3ef55f8859
Notes:
github-actions[bot]
2025-11-01 07:41:47 +00:00
Author: https://github.com/awesomekling
Commit: 3ef55f8859
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6657
2 changed files with 7 additions and 8 deletions
|
|
@ -705,7 +705,7 @@ Utf16FlyString const& Interpreter::get_identifier(IdentifierTableIndex index) co
|
|||
return m_running_execution_context->identifier_table.data()[index.value];
|
||||
}
|
||||
|
||||
ThrowCompletionOr<Value> Interpreter::run_executable(ExecutionContext& context, Executable& executable, Optional<size_t> entry_point, Value initial_accumulator_value)
|
||||
ThrowCompletionOr<Value> Interpreter::run_executable(ExecutionContext& context, Executable& executable, Optional<size_t> entry_point)
|
||||
{
|
||||
dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter will run unit {}", &executable);
|
||||
|
||||
|
|
@ -719,8 +719,6 @@ ThrowCompletionOr<Value> Interpreter::run_executable(ExecutionContext& context,
|
|||
|
||||
ASSERT(executable.registers_and_constants_and_locals_count <= context.registers_and_constants_and_locals_and_arguments_span().size());
|
||||
|
||||
reg(Register::accumulator()) = initial_accumulator_value;
|
||||
|
||||
// NOTE: We only copy the `this` value from ExecutionContext if it's not already set.
|
||||
// If we are re-entering an async/generator context, the `this` value
|
||||
// may have already been cached by a ResolveThisBinding instruction,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue