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

Unified Diff: pkg/smoke/lib/codegen/recorder.dart

Issue 278413002: Fix code generation in polymer: we avoided generating types above HtmlElement in (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « pkg/polymer/pubspec.yaml ('k') | pkg/smoke/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/smoke/lib/codegen/recorder.dart
diff --git a/pkg/smoke/lib/codegen/recorder.dart b/pkg/smoke/lib/codegen/recorder.dart
index 6920534a808577195ef171c73f2ee4894e767148..073e8fef08580a0f5c0969aa8363d07855ef2d40 100644
--- a/pkg/smoke/lib/codegen/recorder.dart
+++ b/pkg/smoke/lib/codegen/recorder.dart
@@ -151,18 +151,18 @@ class Recorder {
/// Adds the declaration of [name] if it was found in [type]. If [recursive]
/// is true, then we continue looking up [name] in the parent classes until we
- /// find it or we reach Object. Returns whether the declaration was found.
- /// When a declaration is found, add also a symbol, getter, and setter if
- /// [includeAccessors] is true.
+ /// find it or we reach [includeUpTo] or Object. Returns whether the
+ /// declaration was found. When a declaration is found, add also a symbol,
+ /// getter, and setter if [includeAccessors] is true.
bool lookupMember(ClassElement type, String name, {bool recursive: false,
- bool includeAccessors: true}) =>
+ bool includeAccessors: true, ClassElement includeUpTo}) =>
_lookupMemberInternal(type, _typeFor(type), name, recursive,
- includeAccessors);
+ includeAccessors, includeUpTo);
/// Helper for [lookupMember] that walks up the type hierarchy including mixin
/// classes.
bool _lookupMemberInternal(ClassElement type, TypeIdentifier id, String name,
- bool recursive, bool includeAccessors) {
+ bool recursive, bool includeAccessors, ClassElement includeUpTo) {
// Exclude members from [Object].
if (type.type.isObject) return false;
generator.addEmptyDeclaration(id);
@@ -210,19 +210,19 @@ class Recorder {
if (recursive) {
lookupParent(type);
var parent = type.supertype != null ? type.supertype.element : null;
- if (parent == null) return false;
+ if (parent == null || parent == includeUpTo) return false;
var parentId = _typeFor(parent);
for (var m in type.mixins) {
var mixinClass = m.element;
var mixinId = _mixins[parentId][mixinClass];
if (_lookupMemberInternal(mixinClass, mixinId, name, false,
- includeAccessors)) {
+ includeAccessors, includeUpTo)) {
return true;
}
parentId = mixinId;
}
return _lookupMemberInternal(parent, parentId, name, true,
- includeAccessors);
+ includeAccessors, includeUpTo);
}
return false;
}
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | pkg/smoke/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698