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

Side by Side Diff: pkg/matcher/lib/mirror_matchers.dart

Issue 313563002: pkg/matcher: Reverting 36881,36896 while investigating dart2js checked crash (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/matcher/lib/matcher.dart ('k') | pkg/matcher/lib/src/core_matchers.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// The mirror matchers library provides some additional matchers that 5 /**
6 /// make use of `dart:mirrors`. 6 * The mirror matchers library provides some additional matchers that
7 * make use of `dart:mirrors`.
8 */
7 library matcher.mirror_matchers; 9 library matcher.mirror_matchers;
8 10
9 import 'dart:mirrors'; 11 import 'dart:mirrors';
10 12
11 import 'matcher.dart'; 13 import 'matcher.dart';
12 14
13 /// Returns a matcher that checks if a class instance has a property 15 /**
14 /// with name [name], and optionally, if that property in turn satisfies 16 * Returns a matcher that checks if a class instance has a property
15 /// a [matcher]. 17 * with name [name], and optionally, if that property in turn satisfies
18 * a [matcher].
19 */
16 Matcher hasProperty(String name, [matcher]) => 20 Matcher hasProperty(String name, [matcher]) =>
17 new _HasProperty(name, matcher == null ? null : wrapMatcher(matcher)); 21 new _HasProperty(name, matcher == null ? null : wrapMatcher(matcher));
18 22
19 class _HasProperty extends Matcher { 23 class _HasProperty extends Matcher {
20 final String _name; 24 final String _name;
21 final Matcher _matcher; 25 final Matcher _matcher;
22 26
23 const _HasProperty(this._name, [this._matcher]); 27 const _HasProperty(this._name, [this._matcher]);
24 28
25 bool matches(item, Map matchState) { 29 bool matches(item, Map matchState) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 var innerDescription = new StringDescription(); 71 var innerDescription = new StringDescription();
68 _matcher.describeMismatch(matchState['value'], innerDescription, 72 _matcher.describeMismatch(matchState['value'], innerDescription,
69 matchState['state'], verbose); 73 matchState['state'], verbose);
70 if (innerDescription.length > 0) { 74 if (innerDescription.length > 0) {
71 mismatchDescription.add(' which ').add(innerDescription.toString()); 75 mismatchDescription.add(' which ').add(innerDescription.toString());
72 } 76 }
73 } 77 }
74 return mismatchDescription; 78 return mismatchDescription;
75 } 79 }
76 } 80 }
OLDNEW
« no previous file with comments | « pkg/matcher/lib/matcher.dart ('k') | pkg/matcher/lib/src/core_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698