Skip to content

Commit 6c7612b

Browse files
authored
Merge branch 'feature.use' into master
2 parents 62bce0c + a0e63ac commit 6c7612b

File tree

13 files changed

+1212
-284
lines changed

13 files changed

+1212
-284
lines changed

lib/src/ast/css/stylesheet.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// MIT-style license that can be found in the LICENSE file or at
33
// https://opensource.org/licenses/MIT.
44

5+
import 'dart:collection';
6+
57
import 'package:source_span/source_span.dart';
68

79
import '../../visitor/interface/css.dart';
@@ -18,7 +20,10 @@ class CssStylesheet extends CssParentNode {
1820

1921
/// Creates an unmodifiable stylesheet containing [children].
2022
CssStylesheet(Iterable<CssNode> children, this.span)
21-
: children = List.unmodifiable(children);
23+
// Use [UnmodifiableListView] rather than [List.unmodifiable] because
24+
// the underlying nodes are mutable anyway, so it's better to have the
25+
// whole thing consistently represent mutation of the underlying data.
26+
: children = UnmodifiableListView(children);
2227

2328
T accept<T>(CssVisitor<T> visitor) => visitor.visitStylesheet(this);
2429
}

0 commit comments

Comments
 (0)