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

Unified Diff: pkg/smoke/lib/smoke.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/mirrors.dart ('k') | pkg/smoke/lib/src/common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/smoke/lib/smoke.dart
diff --git a/pkg/smoke/lib/smoke.dart b/pkg/smoke/lib/smoke.dart
index fe34ddd3fe2cf7c4e63d4873cee2d5e56917f0c0..9d47a3a9706e21a7ecda56a64add7897fd6f3346 100644
--- a/pkg/smoke/lib/smoke.dart
+++ b/pkg/smoke/lib/smoke.dart
@@ -42,6 +42,17 @@ invoke(receiver, Symbol method, List args,
implementation.objectAccessor.invoke(
receiver, method, args, namedArgs: namedArgs, adjust: adjust);
+/// Tells whether [type] is transitively a subclass of [supertype].
+bool isSubclassOf(Type type, Type supertype) =>
+ implementation.typeInspector.isSubclassOf(type, supertype);
+
+// TODO(sigmund): consider adding also:
+// * isImplementationOf(type, subtype) to tells whether [type] declares that it
+// implements the [supertype] interface.
+// * isSubtypeOf(type, subtype): Tells whether [type]'s interface is a sybtype
+// of [supertype]. That is, whether it is a subclass or if [type] implements
+// [supertype].
+
/// Tells whether [type] has a field or getter for [field].
bool hasGetter(Type type, Symbol field) =>
implementation.typeInspector.hasGetter(type, field);
@@ -95,6 +106,10 @@ class QueryOptions {
/// (except [Object]).
final bool includeInherited;
+ /// If [includeInherited], walk up the type hierarchy up to this type
+ /// (defaults to [Object]).
+ final Type includeUpTo;
+
/// Whether to include final fields and getter-only properties.
final bool excludeFinal;
@@ -110,6 +125,7 @@ class QueryOptions {
this.includeFields: true,
this.includeProperties: true,
this.includeInherited: true,
+ this.includeUpTo: Object,
this.excludeFinal: false,
this.includeMethods: false,
this.withAnnotations: null});
@@ -197,6 +213,9 @@ abstract class ObjectAccessorService {
/// A service that provides partial inspection into Dart types.
abstract class TypeInspectorService {
+ /// Tells whether [type] is transitively a subclass of [supertype].
+ bool isSubclassOf(Type type, Type supertype);
+
/// Tells whether [type] has a field or getter for [name].
bool hasGetter(Type type, Symbol name);
« no previous file with comments | « pkg/smoke/lib/mirrors.dart ('k') | pkg/smoke/lib/src/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698