summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-11-04 22:48:09 +0100
committerLinus Groh <mail@linusgroh.de>2021-11-04 23:59:40 +0100
commit0dae7c94207cb895d6749b97b3dac1908b72b0ee (patch)
tree67951301829800719520bf3b91e0013cf6b3dd63 /Userland/Libraries/LibJS/Runtime
parentdd1a808f7e5a99d86acbd05b521c63bcdadf24c4 (diff)
downloadserenity-0dae7c94207cb895d6749b97b3dac1908b72b0ee.zip
LibJS: Replace a couple of TODO()'s in Temporal with InternalError
This helps us to distinguish between crashes because of incomplete code paths and crashes because of genuine bugs more easily when running test262.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp10
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp2
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp
index ffd37edad7..c55f26f4a5 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp
@@ -828,7 +828,7 @@ ThrowCompletionOr<ISODateTime> parse_iso_date_time(GlobalObject& global_object,
Optional<StringView> second_part;
Optional<StringView> fraction_part;
Optional<StringView> calendar_part;
- TODO();
+ return vm.throw_completion<InternalError>(global_object, ErrorType::NotImplemented, "ParseISODateTime");
// 3. Let year be the part of isoString produced by the DateYear production.
// 4. If the first code unit of year is 0x2212 (MINUS SIGN), replace it with the code unit 0x002D (HYPHEN-MINUS).
@@ -961,7 +961,7 @@ ThrowCompletionOr<String> parse_temporal_calendar_string(GlobalObject& global_ob
// a. Throw a RangeError exception.
// 3. Let id be the part of isoString produced by the CalendarName production, or undefined if not present.
Optional<StringView> id_part;
- TODO();
+ return vm.throw_completion<InternalError>(global_object, ErrorType::NotImplemented, "ParseTemporalCalendarString");
// 4. If id is undefined, then
if (!id_part.has_value()) {
@@ -1014,9 +1014,9 @@ ThrowCompletionOr<ISODateTime> parse_temporal_date_time_string(GlobalObject& glo
// 13.40 ParseTemporalDurationString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaldurationstring
ThrowCompletionOr<TemporalDuration> parse_temporal_duration_string(GlobalObject& global_object, String const& iso_string)
{
- (void)global_object;
(void)iso_string;
- TODO();
+ auto& vm = global_object.vm();
+ return vm.throw_completion<InternalError>(global_object, ErrorType::NotImplemented, "ParseTemporalDurationString");
}
// 13.43 ParseTemporalTimeString ( isoString ), https://tc39.es/proposal-temporal/#sec-temporal-parsetemporaltimestring
@@ -1052,7 +1052,7 @@ ThrowCompletionOr<TemporalTimeZone> parse_temporal_time_zone_string(GlobalObject
Optional<StringView> seconds_part;
Optional<StringView> fraction_part;
Optional<StringView> name_part;
- TODO();
+ return vm.throw_completion<InternalError>(global_object, ErrorType::NotImplemented, "ParseTemporalTimeZoneString");
// 4. If z is not undefined, then
if (z_part.has_value()) {
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp
index d677d1e752..d07cbc9171 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp
@@ -121,7 +121,7 @@ ThrowCompletionOr<PlainMonthDay*> to_temporal_month_day(GlobalObject& global_obj
// FIXME: The spec has an issue in this part which makes it unimplementable, namely:
// - ParseTemporalMonthDayString doesn't return a [[Calendar]] field, which is required in step 7.
// This is a known issue, see https://github.com/tc39/proposal-temporal/issues/1502
- TODO();
+ return vm.throw_completion<InternalError>(global_object, ErrorType::NotImplemented, "ToTemporalMonthDay");
}
// 10.5.2 CreateTemporalMonthDay ( isoMonth, isoDay, calendar, referenceISOYear [ , newTarget ] ), https://tc39.es/proposal-temporal/#sec-temporal-createtemporalmonthday