Skip to content

Commit 72ef6a2

Browse files
authored
Fix empty @at-root in the indented syntax (#2311)
1 parent 9d45fad commit 72ef6a2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 1.78.0
22

3+
* Fix a crash when using `@at-root` without any queries or children in the
4+
indented syntax.
5+
36
### JS API
47

58
* Fix a bug where accessing `SourceSpan.url` would crash when a relative URL was

lib/src/parse/stylesheet.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ abstract class StylesheetParser extends Parser {
731731
whitespace();
732732
return _withChildren(_statement, start,
733733
(children, span) => AtRootRule(children, span, query: query));
734-
} else if (lookingAtChildren()) {
734+
} else if (lookingAtChildren() || (indented && atEndOfStatement())) {
735735
return _withChildren(
736736
_statement, start, (children, span) => AtRootRule(children, span));
737737
} else {

0 commit comments

Comments
 (0)