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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/types.dart

Issue 12263009: - Trust type annotations on fields of HTML classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/types.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/types.dart (revision 18508)
+++ sdk/lib/_internal/compiler/implementation/ssa/types.dart (working copy)
@@ -168,12 +168,23 @@
/** Alias for isReadableArray. */
bool isArray() => isReadableArray();
- Element lookupMember(SourceString name, Compiler compiler) {
- if (!isExact()) return null;
+ Element lookupSingleTarget(Selector selector, Compiler compiler) {
+ if (isInterfaceType()) return null;
DartType type = computeType(compiler);
if (type == null) return null;
ClassElement cls = type.element;
- return cls.lookupMember(name);
+ Element member = cls.lookupSelector(selector);
+ if (member == null) return null;
+ // [:ClassElement.lookupSelector:] may return an abstract field,
+ // and selctors don't work well with them.
+ // TODO(ngeoffray): Clean up lookupSelector and selectors to know
+ // if it's a getter or a setter that we're interested in.
+ if (!member.isFunction()) return null;
+ if (!selector.applies(member, compiler)) return null;
+ if (!isExact() && !compiler.world.hasNoOverridingMember(member)) {
+ return null;
+ }
+ return member;
}
DartType computeType(Compiler compiler);
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698