mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Pass source text to ECMAScriptFunctionObject::create()
This commit is contained in:
parent
6e5097b201
commit
1ee7e97e24
Notes:
sideshowbarker
2024-07-17 20:38:11 +09:00
Author: https://github.com/linusg
Commit: 1ee7e97e24
Pull-request: https://github.com/SerenityOS/serenity/pull/12002
7 changed files with 25 additions and 20 deletions
|
@ -748,7 +748,7 @@ ThrowCompletionOr<void> eval_declaration_instantiation(VM& vm, GlobalObject& glo
|
|||
return throw_completion(exception->value());
|
||||
|
||||
for (auto& declaration : functions_to_initialize) {
|
||||
auto* function = ECMAScriptFunctionObject::create(global_object, declaration.name(), declaration.body(), declaration.parameters(), declaration.function_length(), lexical_environment, private_environment, declaration.kind(), declaration.is_strict_mode(), declaration.might_need_arguments_object());
|
||||
auto* function = ECMAScriptFunctionObject::create(global_object, declaration.name(), declaration.source_text(), declaration.body(), declaration.parameters(), declaration.function_length(), lexical_environment, private_environment, declaration.kind(), declaration.is_strict_mode(), declaration.might_need_arguments_object());
|
||||
if (global_var_environment) {
|
||||
TRY(global_var_environment->create_global_function_binding(declaration.name(), function, true));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue