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

Unified Diff: runtime/vm/object.cc

Issue 23810003: Make showHide combinators work with getter/setter names (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | « no previous file | tests/language/import_show_lib.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 27133)
+++ runtime/vm/object.cc (working copy)
@@ -7654,6 +7654,17 @@
bool Namespace::HidesName(const String& name) const {
+ // Quick check for common case with no combinators.
+ if (hide_names() == show_names()) {
+ ASSERT(hide_names() == Array::null());
+ return false;
+ }
+ const String* plain_name = &name;
+ if (Field::IsGetterName(name)) {
+ plain_name = &String::Handle(Field::NameFromGetter(name));
+ } else if (Field::IsSetterName(name)) {
+ plain_name = &String::Handle(Field::NameFromSetter(name));
+ }
// Check whether the name is in the list of explicitly hidden names.
if (hide_names() != Array::null()) {
const Array& names = Array::Handle(hide_names());
@@ -7661,7 +7672,7 @@
intptr_t num_names = names.Length();
for (intptr_t i = 0; i < num_names; i++) {
hidden ^= names.At(i);
- if (name.Equals(hidden)) {
+ if (plain_name->Equals(hidden)) {
return true;
}
}
@@ -7674,7 +7685,7 @@
intptr_t num_names = names.Length();
for (intptr_t i = 0; i < num_names; i++) {
shown ^= names.At(i);
- if (name.Equals(shown)) {
+ if (plain_name->Equals(shown)) {
return false;
}
}
« no previous file with comments | « no previous file | tests/language/import_show_lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698