mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibJS/Bytecode: Pass contains_direct_call_to_eval into ESFO::create
Previously it would pass in `is_arrow_function` as `contains_direct_call_to_eval`, which broke strict mode propagation in arrow functions. This makes test-js work without falling apart because `this` is mysteriously undefined because of the use of arrow functions inside classes, which are strict mode by default.
This commit is contained in:
parent
77f88d00e0
commit
9ad807d08b
Notes:
sideshowbarker
2024-07-17 12:02:22 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/9ad807d08b Pull-request: https://github.com/SerenityOS/serenity/pull/14262 Reviewed-by: https://github.com/alimpfard
1 changed files with 1 additions and 1 deletions
|
@ -494,7 +494,7 @@ ThrowCompletionOr<void> Call::execute_impl(Bytecode::Interpreter& interpreter) c
|
|||
ThrowCompletionOr<void> NewFunction::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
auto& vm = interpreter.vm();
|
||||
interpreter.accumulator() = ECMAScriptFunctionObject::create(interpreter.global_object(), m_function_node.name(), m_function_node.source_text(), m_function_node.body(), m_function_node.parameters(), m_function_node.function_length(), vm.lexical_environment(), vm.running_execution_context().private_environment, m_function_node.kind(), m_function_node.is_strict_mode(), m_function_node.might_need_arguments_object(), m_function_node.is_arrow_function());
|
||||
interpreter.accumulator() = ECMAScriptFunctionObject::create(interpreter.global_object(), m_function_node.name(), m_function_node.source_text(), m_function_node.body(), m_function_node.parameters(), m_function_node.function_length(), vm.lexical_environment(), vm.running_execution_context().private_environment, m_function_node.kind(), m_function_node.is_strict_mode(), m_function_node.might_need_arguments_object(), m_function_node.contains_direct_call_to_eval(), m_function_node.is_arrow_function());
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue