1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

LibJS: Replace some deprecated_string() with utf8_string() in Temporal

The remaining ones are needed for PropertyKey, which is not yet String
compatible.
This commit is contained in:
Linus Groh 2023-01-28 22:58:03 +00:00
parent b41e7b7e86
commit e4158d8555
3 changed files with 3 additions and 3 deletions

View file

@ -146,7 +146,7 @@ ThrowCompletionOr<Value> get_option(VM& vm, Object const& options, PropertyKey c
if (!values.is_empty()) {
// NOTE: Every location in the spec that invokes GetOption with type=boolean also has values=undefined.
VERIFY(value.is_string());
if (auto value_string = TRY(value.as_string().deprecated_string()); !values.contains_slow(value_string))
if (auto value_string = TRY(value.as_string().utf8_string()); !values.contains_slow(value_string))
return vm.throw_completion<RangeError>(ErrorType::OptionIsNotValidValue, value_string, property.as_string());
}

View file

@ -559,7 +559,7 @@ JS_DEFINE_NATIVE_FUNCTION(CalendarPrototype::fields)
return TRY(iterator_close(vm, iterator_record, move(completion)));
}
auto next_value_string = TRY(next_value.as_string().deprecated_string());
auto next_value_string = TRY(next_value.as_string().utf8_string());
// iii. If fieldNames contains nextValue, then
if (field_names.contains_slow(next_value)) {

View file

@ -801,7 +801,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with)
// 18. Assert: Type(offsetString) is String.
VERIFY(offset_string_value.is_string());
auto offset_string = TRY(offset_string_value.as_string().deprecated_string());
auto offset_string = TRY(offset_string_value.as_string().utf8_string());
// 19. Let dateTimeResult be ? InterpretTemporalDateTimeFields(calendar, fields, options).
auto date_time_result = TRY(interpret_temporal_date_time_fields(vm, calendar, *fields, *options));