diff options
author | Linus Groh <mail@linusgroh.de> | 2021-10-18 18:56:58 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-18 21:24:30 +0100 |
commit | ffee3890a77c97dec1c8d4831273bdcba8019a47 (patch) | |
tree | 9f9d81cf744f6f1dc34137efaa122aa06cb9a31c /Userland/Libraries/LibJS | |
parent | 64aaf263a2adf562c20f0db371c01e8421b604f7 (diff) | |
download | serenity-ffee3890a77c97dec1c8d4831273bdcba8019a47.zip |
LibJS: Remove a bunch of forgotten exception checks after TRY_OR_DISCARD
Not quite sure how that happened :^)
Diffstat (limited to 'Userland/Libraries/LibJS')
9 files changed, 0 insertions, 18 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp index 376fdcaadd..f5a65757e4 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp @@ -127,8 +127,6 @@ JS_DEFINE_NATIVE_FUNCTION(DisplayNamesConstructor::supported_locales_of) // 2. Let requestedLocales be ? CanonicalizeLocaleList(locales). auto requested_locales = TRY_OR_DISCARD(canonicalize_locale_list(global_object, locales)); - if (vm.exception()) - return {}; // 3. Return ? SupportedLocales(availableLocales, requestedLocales, options). return TRY_OR_DISCARD(supported_locales(global_object, requested_locales, options)); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp index b3c13e0d7b..2dd89dcd80 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp @@ -106,8 +106,6 @@ JS_DEFINE_NATIVE_FUNCTION(ListFormatConstructor::supported_locales_of) // 2. Let requestedLocales be ? CanonicalizeLocaleList(locales). auto requested_locales = TRY_OR_DISCARD(canonicalize_locale_list(global_object, locales)); - if (vm.exception()) - return {}; // 3. Return ? SupportedLocales(availableLocales, requestedLocales, options). return TRY_OR_DISCARD(supported_locales(global_object, requested_locales, options)); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp index 5ac947a21f..0b282e52f1 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp @@ -74,8 +74,6 @@ JS_DEFINE_NATIVE_FUNCTION(NumberFormatConstructor::supported_locales_of) // 2. Let requestedLocales be ? CanonicalizeLocaleList(locales). auto requested_locales = TRY_OR_DISCARD(canonicalize_locale_list(global_object, locales)); - if (vm.exception()) - return {}; // 3. Return ? SupportedLocales(availableLocales, requestedLocales, options). return TRY_OR_DISCARD(supported_locales(global_object, requested_locales, options)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp index 5761636a73..01b9ad223c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp @@ -141,8 +141,6 @@ JS_DEFINE_NATIVE_FUNCTION(InstantPrototype::add) // 4. Let ns be ? AddInstant(instant.[[Nanoseconds]], duration.[[Hours]], duration.[[Minutes]], duration.[[Seconds]], duration.[[Milliseconds]], duration.[[Microseconds]], duration.[[Nanoseconds]]). auto* ns = TRY_OR_DISCARD(add_instant(global_object, instant->nanoseconds(), duration.hours, duration.minutes, duration.seconds, duration.milliseconds, duration.microseconds, duration.nanoseconds)); - if (vm.exception()) - return {}; // 5. Return ! CreateTemporalInstant(ns). return MUST(create_temporal_instant(global_object, *ns)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp index a005d7ab2d..e73a884726 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp @@ -432,8 +432,6 @@ JS_DEFINE_NATIVE_FUNCTION(PlainDateTimePrototype::with_calendar) // 3. Let calendar be ? ToTemporalCalendar(calendar). auto* calendar = TRY_OR_DISCARD(to_temporal_calendar(global_object, vm.argument(0))); - if (vm.exception()) - return {}; // 4. Return ? CreateTemporalDateTime(dateTime.[[ISOYear]], dateTime.[[ISOMonth]], dateTime.[[ISODay]], dateTime.[[ISOHour]], dateTime.[[ISOMinute]], dateTime.[[ISOSecond]], dateTime.[[ISOMillisecond]], dateTime.[[ISOMicrosecond]], dateTime.[[ISONanosecond]], calendar). return TRY_OR_DISCARD(create_temporal_date_time(global_object, date_time->iso_year(), date_time->iso_month(), date_time->iso_day(), date_time->iso_hour(), date_time->iso_minute(), date_time->iso_second(), date_time->iso_millisecond(), date_time->iso_microsecond(), date_time->iso_nanosecond(), *calendar)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp index 92ab3ba9cb..d1252015d6 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp @@ -192,8 +192,6 @@ JS_DEFINE_NATIVE_FUNCTION(PlainMonthDayPrototype::to_plain_date) // 5. Let receiverFieldNames be ? CalendarFields(calendar, « "day", "monthCode" »). auto receiver_field_names = TRY_OR_DISCARD(calendar_fields(global_object, calendar, { "day"sv, "monthCode"sv })); - if (vm.exception()) - return {}; // 6. Let fields be ? PrepareTemporalFields(monthDay, receiverFieldNames, «»). auto* fields = TRY_OR_DISCARD(prepare_temporal_fields(global_object, *month_day, receiver_field_names, {})); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp index 59be1fcc7e..251f59482e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp @@ -245,8 +245,6 @@ JS_DEFINE_NATIVE_FUNCTION(PlainYearMonthPrototype::to_string) // 3. Set options to ? GetOptionsObject(options). auto* options = TRY_OR_DISCARD(get_options_object(global_object, vm.argument(0))); - if (vm.exception()) - return {}; // 4. Let showCalendar be ? ToShowCalendarOption(options). auto show_calendar = TRY_OR_DISCARD(to_show_calendar_option(global_object, *options)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp index b6991fc55f..d613456109 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp @@ -849,8 +849,6 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::to_plain_month_day) // 7. Let fieldNames be ? CalendarFields(calendar, « "day", "monthCode" »). auto field_names = TRY_OR_DISCARD(calendar_fields(global_object, calendar, { "day"sv, "monthCode"sv })); - if (vm.exception()) - return {}; // 8. Let fields be ? PrepareTemporalFields(temporalDateTime, fieldNames, «»). auto* fields = TRY_OR_DISCARD(prepare_temporal_fields(global_object, *temporal_date_time, field_names, {})); diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp index 2a5ae66689..85ac2a78e0 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp @@ -48,8 +48,6 @@ Value WeakSetConstructor::construct(FunctionObject& new_target) auto& global_object = this->global_object(); auto* weak_set = TRY_OR_DISCARD(ordinary_create_from_constructor<WeakSet>(global_object, new_target, &GlobalObject::weak_set_prototype)); - if (vm.exception()) - return {}; if (vm.argument(0).is_nullish()) return weak_set; |