summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/FunctionConstructor.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-10-04 15:18:52 +0100
committerAndreas Kling <kling@serenityos.org>2020-10-04 19:22:02 +0200
commit123f98201e2447b6628487a5a753d4bcd840d554 (patch)
tree7677a87d16a06f41becb0e46f21a647602d2bbe9 /Libraries/LibJS/Runtime/FunctionConstructor.cpp
parent2e2571743b4612cbec6fd7037375abe3f43af380 (diff)
downloadserenity-123f98201e2447b6628487a5a753d4bcd840d554.zip
LibJS: Use String::formatted() in various other places
Diffstat (limited to 'Libraries/LibJS/Runtime/FunctionConstructor.cpp')
-rw-r--r--Libraries/LibJS/Runtime/FunctionConstructor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibJS/Runtime/FunctionConstructor.cpp b/Libraries/LibJS/Runtime/FunctionConstructor.cpp
index 39c91d00b6..2368635b00 100644
--- a/Libraries/LibJS/Runtime/FunctionConstructor.cpp
+++ b/Libraries/LibJS/Runtime/FunctionConstructor.cpp
@@ -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()) {