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

Unified Diff: pkg/unittest/lib/src/future_matchers.dart

Issue 12393020: Fix build break with dart2js not liking conditional expressions in initializers of const classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « 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/src/future_matchers.dart
===================================================================
--- pkg/unittest/lib/src/future_matchers.dart (revision 19339)
+++ pkg/unittest/lib/src/future_matchers.dart (working copy)
@@ -34,8 +34,7 @@
final Matcher _matcher;
final String _id;
- const _Completes(this._matcher, String id)
- : this._id = (id == '') ? '' : '$id ';
+ const _Completes(this._matcher, this._id);
bool matches(item, MatchState matchState) {
if (item is! Future) return false;
@@ -44,7 +43,8 @@
item.then((value) {
done(() { if (_matcher != null) expect(value, _matcher); });
}, onError: (e) {
- var reason = 'Expected future ${_id}to complete successfully, '
+ var id = _id == '' ? '' : '${_id} ';
Siggi Cherem (dart-lang) 2013/03/01 22:17:15 I was actually going to suggest this anyways, but
+ var reason = 'Expected future ${id}to complete successfully, '
'but it failed with ${e.error}';
if (e.stackTrace != null) {
var stackTrace = e.stackTrace.toString();
« 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