mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:38:12 +00:00
LibJS: Make PrimitiveString::utf8_string() infallible
Work towards #20449.
This commit is contained in:
parent
7849950383
commit
c084269e5f
29 changed files with 79 additions and 93 deletions
|
@ -309,7 +309,7 @@ ThrowCompletionOr<DurationUnitOptions> get_duration_unit_options(VM& vm, String
|
|||
}
|
||||
}
|
||||
} else {
|
||||
style = TRY(style_value.as_string().utf8_string_view());
|
||||
style = style_value.as_string().utf8_string_view();
|
||||
}
|
||||
|
||||
// 4. Let displayField be the string-concatenation of unit and "Display".
|
||||
|
@ -333,7 +333,7 @@ ThrowCompletionOr<DurationUnitOptions> get_duration_unit_options(VM& vm, String
|
|||
}
|
||||
|
||||
// 7. Return the Record { [[Style]]: style, [[Display]]: display }.
|
||||
return DurationUnitOptions { .style = TRY_OR_THROW_OOM(vm, String::from_utf8(style)), .display = TRY(display.as_string().utf8_string()) };
|
||||
return DurationUnitOptions { .style = TRY_OR_THROW_OOM(vm, String::from_utf8(style)), .display = display.as_string().utf8_string() };
|
||||
}
|
||||
|
||||
// 1.1.7 PartitionDurationFormatPattern ( durationFormat, duration ), https://tc39.es/proposal-intl-duration-format/#sec-partitiondurationformatpattern
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue