1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:17:45 +00:00

LibJS: Use String::formatted() in various other places

This commit is contained in:
Linus Groh 2020-10-04 15:18:52 +01:00 committed by Andreas Kling
parent 2e2571743b
commit 123f98201e
7 changed files with 23 additions and 22 deletions

View file

@ -80,7 +80,7 @@ Value FunctionConstructor::construct(Function&)
if (vm.exception())
return {};
}
auto source = String::format("function anonymous(%s) { %s }", parameters_source.characters(), body_source.characters());
auto source = String::formatted("function anonymous({}) {{ {} }}", parameters_source, body_source);
auto parser = Parser(Lexer(source));
auto function_expression = parser.parse_function_node<FunctionExpression>();
if (parser.has_errors()) {