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

LibJS: Make parse_temporal_instant() take a StringView

The underlying parse_temporal_instant_string() function already does
this as well.
This commit is contained in:
Linus Groh 2023-01-26 15:46:03 +00:00
parent f669d2e558
commit 28ee331a93
2 changed files with 3 additions and 3 deletions

View file

@ -100,7 +100,7 @@ ThrowCompletionOr<Instant*> to_temporal_instant(VM& vm, Value item)
}
// 2. Let string be ? ToString(item).
auto string = TRY(item.to_deprecated_string(vm));
auto string = TRY(item.to_string(vm));
// 3. Let epochNanoseconds be ? ParseTemporalInstant(string).
auto* epoch_nanoseconds = TRY(parse_temporal_instant(vm, string));
@ -110,7 +110,7 @@ ThrowCompletionOr<Instant*> to_temporal_instant(VM& vm, Value item)
}
// 8.5.4 ParseTemporalInstant ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalinstant
ThrowCompletionOr<BigInt*> parse_temporal_instant(VM& vm, DeprecatedString const& iso_string)
ThrowCompletionOr<BigInt*> parse_temporal_instant(VM& vm, StringView iso_string)
{
// 1. Assert: Type(isoString) is String.