Skip to content

Commit b977d27

Browse files
disable isolate parsing in debug mode (#854)
Co-authored-by: Dan Field <[email protected]>
1 parent e7a0943 commit b977d27

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Next
44

5+
- Disable Isolate parsing in debug mode.
56
- Fix internal Color representation leakage from `package:vector_graphics_compiler`.
67

78
## 2.0.0+1

lib/src/utilities/_compute_io.dart

Lines changed: 0 additions & 8 deletions
This file was deleted.

lib/src/utilities/_compute_none.dart

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/src/utilities/compute.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import 'dart:async';
22

33
import 'package:flutter/foundation.dart' as foundation;
44

5-
import '_compute_io.dart' if (dart.library.html) '_compute_none.dart';
6-
75
Future<R> _testCompute<Q, R>(
86
foundation.ComputeCallback<Q, R> callback, Q message,
97
{String? debugLabel}) {
@@ -14,11 +12,12 @@ Future<R> _testCompute<Q, R>(
1412
final FutureOr<R> result = callback(message);
1513
if (result is Future<R>) {
1614
return result;
17-
} else {
18-
return foundation.SynchronousFuture<R>(result);
1915
}
16+
return foundation.SynchronousFuture<R>(result);
2017
}
2118

2219
/// A compute implementation that does not spawn isolates in tests.
23-
final foundation.ComputeImpl compute =
24-
isTest ? _testCompute : foundation.compute;
20+
const foundation.ComputeImpl compute =
21+
(foundation.kDebugMode || foundation.kIsWeb)
22+
? _testCompute
23+
: foundation.compute;

0 commit comments

Comments
 (0)