Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1783)

Unified Diff: runtime/vm/parser.cc

Issue 816353012: Mark all private functions in dart: libraries as invisible (*sniff*). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | sdk/lib/_internal/compiler/js_lib/io_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index c2bb941a20406937291a07fff90edf13e12ccd1d..53841db997b827f35f0ee7808235b5c65ce70947 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -3651,12 +3651,7 @@ 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 (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)) {
+ if (library_.is_dart_scheme() && library_.IsPrivate(*method->name)) {
func.set_is_visible(false);
}
if (method->metadata_pos > 0) {
@@ -3782,6 +3777,9 @@ 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);
}
}
@@ -3825,6 +3823,9 @@ 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(&params, setter);
members->AddFunction(setter);
}
@@ -5151,6 +5152,9 @@ 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) {
@@ -5275,9 +5279,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(&params, func);
top_level->functions.Add(func);
@@ -5418,9 +5422,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(&params, func);
top_level->functions.Add(func);
« no previous file with comments | « runtime/vm/object.cc ('k') | sdk/lib/_internal/compiler/js_lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698