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

Unified Diff: pkg/unittest/lib/mirror_matchers.dart

Issue 84993006: Remove use of deprecated mirror API from pkg/unittest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/mirror_matchers.dart
diff --git a/pkg/unittest/lib/mirror_matchers.dart b/pkg/unittest/lib/mirror_matchers.dart
index 7d1597f2ac27f59c752109141a93a6a58ce6c51c..372b1357a4c93750aced10dccf82c9d2b2e5f59f 100644
--- a/pkg/unittest/lib/mirror_matchers.dart
+++ b/pkg/unittest/lib/mirror_matchers.dart
@@ -49,7 +49,11 @@ class _HasProperty extends Matcher {
var mirror = reflect(item);
var classMirror = mirror.type;
var symbol = new Symbol(_name);
- if (!classMirror.getters.containsKey(symbol)) {
+ var candidate = classMirror.declarations[symbol];
+ if (candidate == null ||
+ candidate is! MethodMirror ||
Siggi Cherem (dart-lang) 2013/11/25 20:28:47 shouldn't we exclude if candidate is a VariableMir
+ !candidate.isGetter ||
+ candidate.isStatic) {
rmacnak 2013/11/25 19:54:01 This last clause changes the behavior. Presumably
Siggi Cherem (dart-lang) 2013/11/25 20:28:47 Makes sense, sgtm. Could we however split this che
addStateInfo(matchState, {'reason': 'has no property named "$_name"'});
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698