File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
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
@@ -1029,8 +1032,7 @@ class _ModuleMigrationVisitor extends MigrationVisitor {
1029
1032
newName = declaration.name.substring (importOnlyPrefix.length);
1030
1033
}
1031
1034
1032
- if (_shouldForward (declaration.name) &&
1033
- ! _isPrivate (declaration.name)) {
1035
+ if (_shouldForward (declaration.name) && ! _isPrivate (declaration.name)) {
1034
1036
var subprefix = "" ;
1035
1037
if (importOnlyPrefix != null ) {
1036
1038
var prefix = _prefixFor (declaration.name);
You can’t perform that action at this time.
0 commit comments