Skip to content

Commit f172f06

Browse files
Miscellaneous cleanups (flutter#6813)
- [x] Return the reload message even when paused at a breakpoint. - [x] Only initialize context members if they aren't already initialized.
1 parent ca5e1f3 commit f172f06

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

packages/flutter_tools/lib/executable.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,14 @@ Future<Null> main(List<String> args) async {
8282

8383
return Chain.capture/*<Future<Null>>*/(() async {
8484
// Initialize globals.
85-
context[Logger] = new StdoutLogger();
86-
context[DeviceManager] = new DeviceManager();
87-
context[DevFSConfig] = new DevFSConfig();
88-
Doctor.initGlobal();
85+
if (context[Logger] == null)
86+
context[Logger] = new StdoutLogger();
87+
if (context[DeviceManager] == null)
88+
context[DeviceManager] = new DeviceManager();
89+
if (context[DevFSConfig] == null)
90+
context[DevFSConfig] = new DevFSConfig();
91+
if (context[Doctor] == null)
92+
context[Doctor] = new Doctor();
8993

9094
dynamic result = await runner.run(args);
9195
_exit(result is int ? result : 1);

packages/flutter_tools/lib/src/doctor.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:path/path.dart' as path;
99

1010
import 'android/android_workflow.dart';
1111
import 'base/common.dart';
12-
import 'base/context.dart';
1312
import 'device.dart';
1413
import 'globals.dart';
1514
import 'ios/ios_workflow.dart';
@@ -48,10 +47,6 @@ class Doctor {
4847
_validators.add(new DeviceValidator());
4948
}
5049

51-
static void initGlobal() {
52-
context[Doctor] = new Doctor();
53-
}
54-
5550
IOSWorkflow _iosWorkflow;
5651
AndroidWorkflow _androidWorkflow;
5752

packages/flutter_tools/lib/src/hot.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ class HotRunner extends ResidentRunner {
517517
if ((pauseEvent != null) && (pauseEvent.isPauseEvent)) {
518518
// Isolate is paused. Stop here.
519519
printTrace('Skipping reassemble because isolate is paused.');
520-
return OperationResult.ok;
520+
return new OperationResult(OperationResult.ok.code, reloadMessage);
521521
}
522522
await _evictDirtyAssets();
523523
printTrace('Reassembling application');

0 commit comments

Comments
 (0)