LibJS: Add new spec comments to ISO 8601 early-error handlers

This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/f8489fb
This commit is contained in:
Timothy Flynn 2025-07-20 12:50:45 -04:00 committed by Andreas Kling
parent 3b3ff6f057
commit 7ca3598221

View File

@ -285,6 +285,8 @@ public:
if (!parse_date_day())
return false;
// Note the prohibition on invalid combinations of month and day in 13.31.3.
// https://tc39.es/proposal-temporal/#sec-temporal-iso8601grammar-static-semantics-early-errors
// It is a Syntax Error if IsValidDate of DateSpec is false.
if (!is_valid_date(m_state.parse_result))
return false;
@ -310,6 +312,8 @@ public:
if (!parse_date_day())
return false;
// Note the prohibition on invalid combinations of month and day in 13.31.3.
// https://tc39.es/proposal-temporal/#sec-temporal-iso8601grammar-static-semantics-early-errors
// It is a Syntax Error if IsValidMonthDay of DateSpecMonthDay is false.
if (!is_valid_month_day(m_state.parse_result))
return false;
@ -352,6 +356,8 @@ public:
return false;
}
// Note the prohibition on negative zero in 13.31.3.
// https://tc39.es/proposal-temporal/#sec-temporal-iso8601grammar-static-semantics-early-errors
// It is a Syntax Error if DateYear is "-000000".
if (transaction.parsed_string_view() == "-000000"sv)
return false;