Closed Bug 1803036 Opened 3 years ago Closed 3 years ago

Some TokenStream errors have poor location information

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Parsing things like 1__X will throw a syntax error for the repeated underscores, but the location error will be on the X rather than the underscore.

This is due to a few places in TokenStream not calling ungetCodeUnit in error paths when using getCodeUnit instead of peekCodeUnit.

When reporting errors for invalid numeric separators, we should try to point at
the separator character rather than what follows. This patch adds a few calls to
ungetCodeUnit, similar to other error paths in the TokenStream code.

Blocks: sm-frontend
Severity: -- → S3
Priority: -- → P1
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: