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

Side by Side Diff: pkg/scheduled_test/lib/src/schedule.dart

Issue 15143002: Fix the initialization of PendingCallbacks in scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | « no previous file | pkg/scheduled_test/lib/src/utils.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library schedule; 5 library schedule;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:stack_trace/stack_trace.dart'; 10 import 'package:stack_trace/stack_trace.dart';
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 _totalCallbacks++; 496 _totalCallbacks++;
497 var trace = new Trace.current(); 497 var trace = new Trace.current();
498 var pendingCallback = new PendingCallback._(() { 498 var pendingCallback = new PendingCallback._(() {
499 var fullDescription = description; 499 var fullDescription = description;
500 if (fullDescription == null) { 500 if (fullDescription == null) {
501 fullDescription = "Out-of-band operation #${_totalCallbacks}"; 501 fullDescription = "Out-of-band operation #${_totalCallbacks}";
502 } 502 }
503 503
504 var stackString = prefixLines(terseTraceString(trace)); 504 var stackString = prefixLines(terseTraceString(trace));
505 fullDescription += "\n\nStack trace:\n$stackString"; 505 fullDescription += "\n\nStack trace:\n$stackString";
506 return fullDescription;
506 }); 507 });
507 _pendingCallbacks.add(pendingCallback); 508 _pendingCallbacks.add(pendingCallback);
508 509
509 return (arg) { 510 return (arg) {
510 try { 511 try {
511 return fn(arg); 512 return fn(arg);
512 } catch (e, stackTrace) { 513 } catch (e, stackTrace) {
513 var error = new ScheduleError.from( 514 var error = new ScheduleError.from(
514 _schedule, e, stackTrace: stackTrace); 515 _schedule, e, stackTrace: stackTrace);
515 if (_timedOut()) { 516 if (_timedOut()) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 /// The string description of the callback. 607 /// The string description of the callback.
607 String get description { 608 String get description {
608 if (_description == null) _description = _thunk(); 609 if (_description == null) _description = _thunk();
609 return _description; 610 return _description;
610 } 611 }
611 612
612 String toString() => description; 613 String toString() => description;
613 614
614 PendingCallback._(this._thunk); 615 PendingCallback._(this._thunk);
615 } 616 }
OLDNEW
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698