Miscellaneous cleanups (#6813)

- [x] Return the reload message even when paused at a breakpoint.
- [x] Only initialize context members if they aren't already initialized.
This commit is contained in:
John McCutchan 2016-11-10 15:28:19 -08:00 committed by GitHub
parent ca5e1f3f23
commit f172f0675d
3 changed files with 9 additions and 10 deletions

View file

@ -82,10 +82,14 @@ Future<Null> main(List<String> args) async {
return Chain.capture/*<Future<Null>>*/(() async { return Chain.capture/*<Future<Null>>*/(() async {
// Initialize globals. // Initialize globals.
if (context[Logger] == null)
context[Logger] = new StdoutLogger(); context[Logger] = new StdoutLogger();
if (context[DeviceManager] == null)
context[DeviceManager] = new DeviceManager(); context[DeviceManager] = new DeviceManager();
if (context[DevFSConfig] == null)
context[DevFSConfig] = new DevFSConfig(); context[DevFSConfig] = new DevFSConfig();
Doctor.initGlobal(); if (context[Doctor] == null)
context[Doctor] = new Doctor();
dynamic result = await runner.run(args); dynamic result = await runner.run(args);
_exit(result is int ? result : 1); _exit(result is int ? result : 1);

View file

@ -9,7 +9,6 @@ import 'package:path/path.dart' as path;
import 'android/android_workflow.dart'; import 'android/android_workflow.dart';
import 'base/common.dart'; import 'base/common.dart';
import 'base/context.dart';
import 'device.dart'; import 'device.dart';
import 'globals.dart'; import 'globals.dart';
import 'ios/ios_workflow.dart'; import 'ios/ios_workflow.dart';
@ -48,10 +47,6 @@ class Doctor {
_validators.add(new DeviceValidator()); _validators.add(new DeviceValidator());
} }
static void initGlobal() {
context[Doctor] = new Doctor();
}
IOSWorkflow _iosWorkflow; IOSWorkflow _iosWorkflow;
AndroidWorkflow _androidWorkflow; AndroidWorkflow _androidWorkflow;

View file

@ -517,7 +517,7 @@ class HotRunner extends ResidentRunner {
if ((pauseEvent != null) && (pauseEvent.isPauseEvent)) { if ((pauseEvent != null) && (pauseEvent.isPauseEvent)) {
// Isolate is paused. Stop here. // Isolate is paused. Stop here.
printTrace('Skipping reassemble because isolate is paused.'); printTrace('Skipping reassemble because isolate is paused.');
return OperationResult.ok; return new OperationResult(OperationResult.ok.code, reloadMessage);
} }
await _evictDirtyAssets(); await _evictDirtyAssets();
printTrace('Reassembling application'); printTrace('Reassembling application');