File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ class _ModuleMigrationVisitor extends MigrationVisitor {
352
352
if (declaration.isForwarded) return ;
353
353
354
354
var name = declaration.name;
355
- if (_isPrivate (name)
355
+ if (_isPrivate (name) &&
356
356
references.referencedOutsideDeclaringStylesheet (declaration)) {
357
357
// Remove leading `-` since private members can't be accessed outside
358
358
// the module they're declared in.
@@ -365,8 +365,11 @@ class _ModuleMigrationVisitor extends MigrationVisitor {
365
365
}
366
366
}
367
367
368
- bool _isPrivate (String name) {
369
- return name.startsWith ('-' ) && ! name.startsWith ('--' );
368
+ /// Returns whether [identifier] is a private member name.
369
+ ///
370
+ /// Assumes [identifier] is a valid CSS identifier.
371
+ bool _isPrivate (String identifier) {
372
+ return identifier.startsWith ('-' ) || identifier.startsWith ('_' );
370
373
}
371
374
372
375
/// Returns whether the member named [name] should be forwarded in the
You can’t perform that action at this time.
0 commit comments