Skip to content

Commit

Permalink
Fix empty @at-root in the indented syntax (#2311)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Aug 19, 2024
1 parent 9d45fad commit 72ef6a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 1.78.0

* Fix a crash when using `@at-root` without any queries or children in the
indented syntax.

### JS API

* Fix a bug where accessing `SourceSpan.url` would crash when a relative URL was
Expand Down
2 changes: 1 addition & 1 deletion lib/src/parse/stylesheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ abstract class StylesheetParser extends Parser {
whitespace();
return _withChildren(_statement, start,
(children, span) => AtRootRule(children, span, query: query));
} else if (lookingAtChildren()) {
} else if (lookingAtChildren() || (indented && atEndOfStatement())) {
return _withChildren(
_statement, start, (children, span) => AtRootRule(children, span));
} else {
Expand Down

0 comments on commit 72ef6a2

Please sign in to comment.