Chromium Code Reviews| Index: runtime/vm/parser.cc |
| =================================================================== |
| --- runtime/vm/parser.cc (revision 39425) |
| +++ runtime/vm/parser.cc (working copy) |
| @@ -9553,6 +9553,15 @@ |
| const String& ident) { |
| TRACE_PARSER("ResolveIdentInPrefixScope"); |
| HANDLESCOPE(I); |
| + if (ident.CharAt(0) == '_') { |
|
srdjan
2014/08/21 17:02:21
Should we use Library::kPrivateIdentifierStart?
hausner
2014/08/21 17:06:20
Done.
|
| + // Private names are not exported by libraries. The name mangling |
| + // of private names with a library-specific suffix usually ensures |
| + // that _x in library A is not found when looked up from library B. |
| + // In the pathological case where a library includes itself with |
| + // a prefix, the name mangling would not help in hiding the private |
| + // name, so we need to explicitly reject private names here. |
| + return NULL; |
| + } |
| Object& obj = Object::Handle(I); |
| if (prefix.is_loaded()) { |
| obj = prefix.LookupObject(ident); |