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

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

Issue 173473002: Adapting observe to use smoke (this is built on top of the previous change that (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/polymer/lib/src/declaration.dart ('k') | pkg/smoke/lib/smoke.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/smoke/lib/mirrors.dart
diff --git a/pkg/smoke/lib/mirrors.dart b/pkg/smoke/lib/mirrors.dart
index 38ea40bce1048b5f7ca5bbf798b685e8124256ed..bcaa42ab99ae4cfebfb2314b2a53c83e16a0ac38 100644
--- a/pkg/smoke/lib/mirrors.dart
+++ b/pkg/smoke/lib/mirrors.dart
@@ -145,7 +145,7 @@ class ReflectiveTypeInspectorService implements TypeInspectorService {
var name = member.simpleName;
bool isMethod = false;
if (member is VariableMirror) {
- if (!options.includeProperties) continue;
+ if (!options.includeFields) continue;
if (options.excludeFinal && member.isFinal) continue;
}
@@ -248,12 +248,14 @@ class _MirrorDeclaration implements Declaration {
Symbol get name => _original.simpleName;
- /// Whether the symbol is a property (either this or [isMethod] is true).
- bool get isProperty => _original is VariableMirror ||
- (_original is MethodMirror && !_original.isRegularMethod);
+ DeclarationKind get kind => isField ? FIELD : isProperty ? PROPERTY : METHOD;
+
+ bool get isField => _original is VariableMirror;
+
+ bool get isProperty =>
+ _original is MethodMirror && !_original.isRegularMethod;
- /// Whether the symbol is a method (either this or [isProperty] is true)
- bool get isMethod => !isProperty;
+ bool get isMethod => !isField && !isProperty;
/// If this is a property, whether it's read only (final fields or properties
/// with no setter).
@@ -283,7 +285,8 @@ class _MirrorDeclaration implements Declaration {
return (new StringBuffer()
..write('[declaration ')
..write(name)
- ..write(isProperty ? ' (property) ' : ' (method) ')
+ ..write(isField ? ' (field) '
+ : (isProperty ? ' (property) ' : ' (method) '))
..write(isFinal ? 'final ' : '')
..write(isStatic ? 'static ' : '')
..write(annotations)
« no previous file with comments | « pkg/polymer/lib/src/declaration.dart ('k') | pkg/smoke/lib/smoke.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698