Closed Bug 1948704 Opened 1 month ago Closed 28 days ago

Better error messages for Temporal parser

Categories

(Core :: JavaScript: Standard Library, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

No description provided.

Improves the error message for Temporal.Duration.from("P1")
from:
"RangeError: unexpected garbage after end of input"
to:
"RangeError: missing duration unit designator"

Improves the error message when multiple parse goals are tried.

For example Temporal.PlainTime.from("10:00Z") reported:
"RangeError: missing four digit year"
but is now reporting:
"RangeError: unexpected UTC designator 'Z'"

Improve the error message to indicate there was an error while parsing a
string. And add the parse goal to give a hint how the string was parsed.

Severity: -- → N/A
Priority: -- → P2
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c6f922ad21c6 Part 1: Improve error message for missing duration unit designator. r=dminor https://hg.mozilla.org/integration/autoland/rev/1e6ac0d665fd Part 2: Track error for largest valid prefix. r=dminor https://hg.mozilla.org/integration/autoland/rev/a3a22dde7373 Part 3: Rename error for extra characters at end of string. r=dminor https://hg.mozilla.org/integration/autoland/rev/94ea0a0d0a5c Part 4: Add parse goal to error message. r=dminor https://hg.mozilla.org/integration/autoland/rev/28c0017a7853 Part 5: Add error for empty strings. r=dminor
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: