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

Unified Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 2997033002: Revert "Implement .getCallType" and "Update status" (Closed)
Patch Set: Created 3 years, 4 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
Index: pkg/compiler/lib/src/js_backend/namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 9ac8b1ea328970cd8839ace16e0a91a32ccc5b68..66d8086b7af75c24e6c620cc96d12064ef51a66a 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -12,7 +12,7 @@ import '../closure.dart';
import '../common.dart';
import '../common/names.dart' show Identifiers, Selectors;
import '../constants/values.dart';
-import '../common_elements.dart' show CommonElements, ElementEnvironment;
+import '../common_elements.dart' show CommonElements;
import '../diagnostics/invariant.dart' show DEBUG_MODE;
import '../elements/elements.dart'
show
@@ -578,8 +578,6 @@ class Namer {
_literalLazyGetterPrefix = new StringBackedName(lazyGetterPrefix);
}
- ElementEnvironment get _elementEnvironment => _closedWorld.elementEnvironment;
-
CommonElements get _commonElements => _closedWorld.commonElements;
NativeData get _nativeData => _closedWorld.nativeData;
@@ -955,26 +953,11 @@ class Namer {
}
bool _isShadowingSuperField(FieldEntity element) {
- assert(element.isField);
- String fieldName = element.name;
- bool isPrivate = Name.isPrivateName(fieldName);
- LibraryEntity memberLibrary = element.library;
- ClassEntity lookupClass =
- _elementEnvironment.getSuperClass(element.enclosingClass);
- while (lookupClass != null) {
- MemberEntity foundMember =
- _elementEnvironment.lookupClassMember(lookupClass, fieldName);
- if (foundMember != null) {
- if (foundMember.isField) {
- if (!isPrivate || memberLibrary == foundMember.library) {
- // Private fields can only be shadowed by a field declared in the
- // same library.
- return true;
- }
- }
- }
- lookupClass = _elementEnvironment.getSuperClass(lookupClass);
+ ClassEntity cls = element.enclosingClass;
+ if (cls is ClassElement) {
+ return cls.hasFieldShadowedBy(element);
}
+ // TODO(redemption): Support class entities.
return false;
}

Powered by Google App Engine
This is Rietveld 408576698