Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions polyfill/lib/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export const ES = ObjectAssign({}, ES2020, {
if (!match) throw new RangeError(`invalid ISO 8601 string: ${isoString}`);
let yearString = match[1];
if (yearString[0] === '\u2212') yearString = `-${yearString.slice(1)}`;
if (yearString === '-000000') throw new RangeError(`invalid ISO 8601 string: ${isoString}`);
const year = ES.ToInteger(yearString);
const month = ES.ToInteger(match[2] || match[4]);
const day = ES.ToInteger(match[3] || match[5]);
Expand Down Expand Up @@ -373,6 +374,7 @@ export const ES = ObjectAssign({}, ES2020, {
if (match) {
let yearString = match[1];
if (yearString[0] === '\u2212') yearString = `-${yearString.slice(1)}`;
if (yearString === '-000000') throw new RangeError(`invalid ISO 8601 string: ${isoString}`);
year = ES.ToInteger(yearString);
month = ES.ToInteger(match[2]);
calendar = match[3];
Expand Down
2 changes: 2 additions & 0 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,7 @@ <h1>ParseISODateTime ( _isoString_ )</h1>
1. Let _minute_ be the part of _isoString_ produced by the |TimeMinute|, |TimeMinuteNotValidDay|, |TimeMinuteThirtyOnly|, or |TimeMinuteThirtyOneOnly| productions, or *undefined* if none of those are present.
1. Let _second_ be the part of _isoString_ produced by the |TimeSecond| or |TimeSecondNotValidMonth| productions, or *undefined* if neither of those are present.
1. If the first code unit of _year_ is 0x2212 (MINUS SIGN), replace it with the code unit 0x002D (HYPHEN-MINUS).
1. If ! SameValue(_year_, *"-000000"*) is *true*, throw a *RangeError* exception.
1. Set _year_ to ! ToIntegerOrInfinity(_year_).
1. If _month_ is *undefined*, then
1. Set _month_ to 1.
Expand Down Expand Up @@ -1512,6 +1513,7 @@ <h1>ParseTemporalYearMonthString ( _isoString_ )</h1>
1. Assert: Type(_isoString_) is String.
1. If _isoString_ does not satisfy the syntax of a |TemporalYearMonthString| (see <emu-xref href="#sec-temporal-iso8601grammar"></emu-xref>), then
1. Throw a *RangeError* exception.
1. If ! SameValue(_isoString_, *"-000000"*) is *true*, throw a *RangeError* exception.
1. If _isoString_ contains a |UTCDesignator|, then
1. Throw a *RangeError* exception.
1. Let _result_ be ? ParseISODateTime(_isoString_).
Expand Down