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

Side by Side Diff: samples/dartcombat/state.dart

Issue 11827017: Update remaining usages of Completer.completeException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 11 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of dartcombatlib; 5 part of dartcombatlib;
6 6
7 void spawnPlayer() { 7 void spawnPlayer() {
8 PlayerState state = new PlayerState(); 8 PlayerState state = new PlayerState();
9 port.receive(state.dispatch); 9 port.receive(state.dispatch);
10 } 10 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 case Constants.SUNK: 232 case Constants.SUNK:
233 sunk.complete(true); 233 sunk.complete(true);
234 break; 234 break;
235 case Constants.MISS: 235 case Constants.MISS:
236 sunk.complete(false); 236 sunk.complete(false);
237 break; 237 break;
238 } 238 }
239 }); 239 });
240 shot.handleException((String error) { 240 shot.handleException((String error) {
241 _recordFailedShot(x, y); 241 _recordFailedShot(x, y);
242 sunk.completeException(error); 242 sunk.completeError(error);
243 return true; 243 return true;
244 }); 244 });
245 // We don't actually chain sunk.cancel with shot.cancel because individual 245 // We don't actually chain sunk.cancel with shot.cancel because individual
246 // shots can't be cancelled. 246 // shots can't be cancelled.
247 } else { 247 } else {
248 sunk.complete(false); 248 sunk.complete(false);
249 } 249 }
250 } 250 }
251 251
252 /** checks that a shot is in range and has not been done before. */ 252 /** checks that a shot is in range and has not been done before. */
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 case Constants.SUNK: 296 case Constants.SUNK:
297 totalHits++; 297 totalHits++;
298 boatsSunk++; 298 boatsSunk++;
299 _enemyView.addHit(x, y); 299 _enemyView.addHit(x, y);
300 enemyGrid.hit(x, y); 300 enemyGrid.hit(x, y);
301 break; 301 break;
302 } 302 }
303 _enemyView.statusBar.updateStatus(); 303 _enemyView.statusBar.updateStatus();
304 } 304 }
305 } 305 }
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698