mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
AK: Use an enum instead of a bool for String::replace(all_occurences)
This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
This commit is contained in:
@@ -213,7 +213,7 @@ String Token::string_value(StringValueStatus& status) const
|
||||
// 12.8.6.2 Static Semantics: TRV, https://tc39.es/ecma262/#sec-static-semantics-trv
|
||||
String Token::raw_template_value() const
|
||||
{
|
||||
return value().replace("\r\n", "\n", true).replace("\r", "\n", true);
|
||||
return value().replace("\r\n", "\n", ReplaceMode::All).replace("\r", "\n", ReplaceMode::All);
|
||||
}
|
||||
|
||||
bool Token::bool_value() const
|
||||
|
||||
Reference in New Issue
Block a user