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

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
Index: pkg/smoke/lib/mirrors.dart
diff --git a/pkg/smoke/lib/mirrors.dart b/pkg/smoke/lib/mirrors.dart
index ffd815d40cffbdd1a52fc23173b9407d2d1f7676..2035937c13b791d21639f3731ce5a1c395937908 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,12 @@ 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);
+ 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 +283,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/observe/pubspec.yaml ('k') | pkg/smoke/lib/smoke.dart » ('j') | pkg/smoke/lib/smoke.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698