Index: runtime/vm/parser.cc |
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc |
index 53841db997b827f35f0ee7808235b5c65ce70947..c2bb941a20406937291a07fff90edf13e12ccd1d 100644 |
--- a/runtime/vm/parser.cc |
+++ b/runtime/vm/parser.cc |
@@ -3651,7 +3651,12 @@ void Parser::ParseMethodOrConstructor(ClassDesc* members, MemberDesc* method) { |
func.set_end_token_pos(method_end_pos); |
func.set_is_redirecting(is_redirecting); |
func.set_modifier(async_modifier); |
- if (library_.is_dart_scheme() && library_.IsPrivate(*method->name)) { |
+ if (method->has_native && library_.is_dart_scheme() && |
+ library_.IsPrivate(*method->name)) { |
+ func.set_is_visible(false); |
+ } |
+ if (method->IsFactoryOrConstructor() && library_.is_dart_scheme() && |
+ library_.IsPrivate(*method->name)) { |
func.set_is_visible(false); |
} |
if (method->metadata_pos > 0) { |
@@ -3777,9 +3782,6 @@ void Parser::ParseFieldDefinition(ClassDesc* members, MemberDesc* field) { |
field->name_pos); |
getter.set_result_type(*field->type); |
getter.set_is_debuggable(false); |
- if (library_.is_dart_scheme() && library_.IsPrivate(*field->name)) { |
- getter.set_is_visible(false); |
- } |
members->AddFunction(getter); |
} |
} |
@@ -3823,9 +3825,6 @@ void Parser::ParseFieldDefinition(ClassDesc* members, MemberDesc* field) { |
field->type); |
setter.set_result_type(Type::Handle(I, Type::VoidType())); |
setter.set_is_debuggable(false); |
- if (library_.is_dart_scheme() && library_.IsPrivate(*field->name)) { |
- setter.set_is_visible(false); |
- } |
AddFormalParamsToFunction(¶ms, setter); |
members->AddFunction(setter); |
} |
@@ -5152,9 +5151,6 @@ void Parser::ParseTopLevelVariable(TopLevel* top_level, |
name_pos); |
getter.set_result_type(type); |
getter.set_is_debuggable(false); |
- if (library_.is_dart_scheme() && library_.IsPrivate(var_name)) { |
- getter.set_is_visible(false); |
- } |
top_level->functions.Add(getter); |
} |
} else if (is_final) { |
@@ -5279,9 +5275,9 @@ void Parser::ParseTopLevelFunction(TopLevel* top_level, |
func.set_modifier(func_modifier); |
if (is_native) { |
func.set_is_debuggable(false); |
- } |
- if (library_.is_dart_scheme() && library_.IsPrivate(func_name)) { |
- func.set_is_visible(false); |
+ if (library_.is_dart_scheme() && library_.IsPrivate(func_name)) { |
+ func.set_is_visible(false); |
+ } |
} |
AddFormalParamsToFunction(¶ms, func); |
top_level->functions.Add(func); |
@@ -5422,9 +5418,9 @@ void Parser::ParseTopLevelAccessor(TopLevel* top_level, |
func.set_modifier(func_modifier); |
if (is_native) { |
func.set_is_debuggable(false); |
- } |
- if (library_.is_dart_scheme() && library_.IsPrivate(accessor_name)) { |
- func.set_is_visible(false); |
+ if (library_.is_dart_scheme() && library_.IsPrivate(accessor_name)) { |
+ func.set_is_visible(false); |
+ } |
} |
AddFormalParamsToFunction(¶ms, func); |
top_level->functions.Add(func); |