Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

access first child with optional chaining #49

Closed
wants to merge 1 commit into from
Closed

access first child with optional chaining #49

wants to merge 1 commit into from

Conversation

dtl
Copy link

@dtl dtl commented May 7, 2024

A node does not always have a first child. As an
example, empty <styles> in a Svelte components
throw an error because first child attributes are
accessed directly even if the first child is undefined (or null).

This may also fix #40

A node does not always have a first child. As an
example, empty `<styles>` in a Svelte components
throw an error because the first child is
accessed directly.
@dtl dtl marked this pull request as draft May 7, 2024 14:11
@dtl dtl closed this May 7, 2024
@dtl dtl deleted the missing-first-child-fix branch May 7, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breaks when the source file only contains @at rules.
1 participant