diff --git a/Userland/Libraries/LibJS/Runtime/ErrorTypes.h b/Userland/Libraries/LibJS/Runtime/ErrorTypes.h index 0976943b82..33a14f3be0 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorTypes.h +++ b/Userland/Libraries/LibJS/Runtime/ErrorTypes.h @@ -52,7 +52,6 @@ M(IntlInvalidTime, "Time value must be between -8.64E15 and 8.64E15") \ M(IntlInvalidUnit, "Unit {} is not a valid time unit") \ M(IntlMinimumExceedsMaximum, "Minimum value {} is larger than maximum value {}") \ - M(IntlNumberIsNaN, "{} must not be NaN") \ M(IntlNumberIsNaNOrInfinity, "Number must not be NaN or Infinity") \ M(IntlNumberIsNaNOrOutOfRange, "Value {} is NaN or is not between {} and {}") \ M(IntlOptionUndefined, "Option {} must be defined when option {} is {}") \ @@ -101,6 +100,7 @@ M(NotIterable, "{} is not iterable") \ M(NotObjectCoercible, "{} cannot be converted to an object") \ M(NotUndefined, "{} is not undefined") \ + M(NumberIsNaN, "{} must not be NaN") \ M(ObjectDefineOwnPropertyReturnedFalse, "Object's [[DefineOwnProperty]] method returned false") \ M(ObjectDeleteReturnedFalse, "Object's [[Delete]] method returned false") \ M(ObjectFreezeFailed, "Could not freeze object") \ diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp index 21ecf72834..56b378c55a 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp @@ -1793,9 +1793,9 @@ ThrowCompletionOr> partition_number_range_pat { // 1. If x is NaN or y is NaN, throw a RangeError exception. if (start.is_nan()) - return vm.throw_completion(ErrorType::IntlNumberIsNaN, "start"sv); + return vm.throw_completion(ErrorType::NumberIsNaN, "start"sv); if (end.is_nan()) - return vm.throw_completion(ErrorType::IntlNumberIsNaN, "end"sv); + return vm.throw_completion(ErrorType::NumberIsNaN, "end"sv); // 2. Let result be a new empty List. Vector result; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp index b6c676a9b3..88e5d7a158 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRules.cpp @@ -147,9 +147,9 @@ ThrowCompletionOr<::Locale::PluralCategory> resolve_plural_range(VM& vm, PluralR // 5. If x is NaN or y is NaN, throw a RangeError exception. if (start.is_nan()) - return vm.throw_completion(ErrorType::IntlNumberIsNaN, "start"sv); + return vm.throw_completion(ErrorType::NumberIsNaN, "start"sv); if (end.is_nan()) - return vm.throw_completion(ErrorType::IntlNumberIsNaN, "end"sv); + return vm.throw_completion(ErrorType::NumberIsNaN, "end"sv); // 6. Let xp be ! ResolvePlural(pluralRules, x). auto start_plurality = MUST_OR_THROW_OOM(resolve_plural(vm, plural_rules, start)); diff --git a/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp index ae706d4b42..accfeb5a3c 100644 --- a/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp @@ -224,7 +224,7 @@ static ThrowCompletionOr get_set_record(VM& vm, Value value) // 4. NOTE: If rawSize is undefined, then numSize will be NaN. // 5. If numSize is NaN, throw a TypeError exception. if (number_size.is_nan()) - return vm.throw_completion(ErrorType::IntlNumberIsNaN, "size"sv); + return vm.throw_completion(ErrorType::NumberIsNaN, "size"sv); // 6. Let intSize be ! ToIntegerOrInfinity(numSize). auto integer_size = MUST(number_size.to_integer_or_infinity(vm));