mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibJS: Convert to_utf16_string() to ThrowCompletionOr
This commit is contained in:
parent
4d8912a92b
commit
da59c77fe3
Notes:
sideshowbarker
2024-07-18 02:47:42 +09:00
Author: https://github.com/linusg
Commit: da59c77fe3
Pull-request: https://github.com/SerenityOS/serenity/pull/10452
Reviewed-by: https://github.com/IdanHo ✅
5 changed files with 30 additions and 90 deletions
|
@ -883,11 +883,7 @@ Value canonical_numeric_index_string(GlobalObject& global_object, PropertyName c
|
|||
// 22.1.3.17.1 GetSubstitution ( matched, str, position, captures, namedCaptures, replacement ), https://tc39.es/ecma262/#sec-getsubstitution
|
||||
ThrowCompletionOr<String> get_substitution(GlobalObject& global_object, Utf16View const& matched, Utf16View const& str, size_t position, Span<Value> captures, Value named_captures, Value replacement)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
|
||||
auto replace_string = replacement.to_utf16_string(global_object);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto replace_string = TRY(replacement.to_utf16_string(global_object));
|
||||
auto replace_view = replace_string.view();
|
||||
|
||||
StringBuilder result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue