From 123f98201e2447b6628487a5a753d4bcd840d554 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 4 Oct 2020 15:18:52 +0100 Subject: LibJS: Use String::formatted() in various other places --- Libraries/LibJS/Runtime/FunctionConstructor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Libraries/LibJS/Runtime/FunctionConstructor.cpp') 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(); if (parser.has_errors()) { -- cgit v1.2.3