mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Name functions created by "Function" "anonymous"
...as it is supposed to be.
This commit is contained in:
parent
e347d6bdb8
commit
ae05dc8abc
Notes:
sideshowbarker
2024-07-19 07:02:24 +09:00
Author: https://github.com/linusg
Commit: ae05dc8abc
Pull-request: https://github.com/SerenityOS/serenity/pull/2068
2 changed files with 5 additions and 1 deletions
|
@ -66,7 +66,7 @@ Value FunctionConstructor::construct(Interpreter& interpreter)
|
|||
parameters_source = parameters_builder.build();
|
||||
body_source = interpreter.argument(interpreter.argument_count() - 1).to_string();
|
||||
}
|
||||
auto source = String::format("function (%s) { %s }", parameters_source.characters(), body_source.characters());
|
||||
auto source = String::format("function anonymous(%s) { %s }", parameters_source.characters(), body_source.characters());
|
||||
auto parser = Parser(Lexer(source));
|
||||
auto function_expression = parser.parse_function_node<FunctionExpression>();
|
||||
if (parser.has_errors()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue