[breaking] Expose the script parser's diagnostics as ast.errors instead of throwing - #81
Merged
NullVoxPopuli merged 1 commit intoAug 25, 2026
Conversation
oxc-parser returns an empty program.body on an unrecoverable script error, indistinguishable from an empty file. Forward its diagnostics on the File node so callers can tell the two apart. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FsXgxh6vNRWMCNcAQ3g6TN
NullVoxPopuli-ai-agent
added a commit
to NullVoxPopuli-ai-agent/glint
that referenced
this pull request
Aug 25, 2026
Mid-keystroke, a broken script already goes one of two ways on the TS path: content-tag fails and the raw source is kept with verification off so the type-checker's recovering parser powers completions, or swc tolerates it and the templates are emitted normally. oxc tolerates less than swc, so the standalone entry had a third mode in between: templates emitted with no import bindings or placement. Collapse it into the first: when ember-estree reports script errors (ast.errors, NullVoxPopuli/ember-estree#81), record one as a content-tag-style error and keep the raw source, exactly as on content-tag failure. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FsXgxh6vNRWMCNcAQ3g6TN
NullVoxPopuli
approved these changes
Aug 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
oxc-parser has no fault-tolerant mode: on an unrecoverable script error it returns an empty
program.body, whichtoTreecurrently hands back looking exactly like an empty file.This forwards oxc's diagnostics on the
Filenode:Type added (
FileNode.errors: ParseError[]), README note, tests. The custom-parserpath is unchanged (it returns whatever the parser returned).Context: glint's standalone transform (typed-ember/glint#1226) degrades to no-imports /
context-thiswhen the script doesn't parse; with this it can at least tell that it did.🤖 Generated with Claude Code
https://claude.ai/code/session_01FsXgxh6vNRWMCNcAQ3g6TN