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

Unified Diff: pkg/smoke/lib/static.dart

Issue 180273004: Fixes in smoke, which in turn should fix todomvc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « pkg/smoke/lib/src/common.dart ('k') | pkg/smoke/test/common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/smoke/lib/static.dart
diff --git a/pkg/smoke/lib/static.dart b/pkg/smoke/lib/static.dart
index c2b518372ed046e0fa99c75ee8687f4106fbc825..4b276fc575dd7b63feb1694996f1b2940a6e986a 100644
--- a/pkg/smoke/lib/static.dart
+++ b/pkg/smoke/lib/static.dart
@@ -114,6 +114,19 @@ class _GeneratedObjectAccessorService implements ObjectAccessorService {
/// Implements [TypeInspectorService] using a static configuration.
class _GeneratedTypeInspectorService implements TypeInspectorService {
+ bool isSubclassOf(Type type, Type supertype) {
+ if (type == supertype || supertype == Object) return true;
+ while (type != Object) {
+ var parentType = _configuration.parents[type];
+ if (parentType == supertype) return true;
+ if (parentType == null) {
+ throw new MissingCodeException('superclass of "$type" ($parentType)');
+ }
+ type = parentType;
+ }
+ return false;
+ }
+
bool hasGetter(Type type, Symbol name) {
var decl = _findDeclaration(type, name);
// No need to check decl.isProperty because methods are also automatically
@@ -155,7 +168,8 @@ class _GeneratedTypeInspectorService implements TypeInspectorService {
if (superclass == null) {
throw new MissingCodeException('superclass of "$type"');
}
- result = (superclass == Object) ? [] : query(superclass, options);
+ result = (superclass == options.includeUpTo) ? []
+ : query(superclass, options);
} else {
result = [];
}
« no previous file with comments | « pkg/smoke/lib/src/common.dart ('k') | pkg/smoke/test/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698