Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Remove use of NullThrownError (#116122)
Browse files Browse the repository at this point in the history
  • Loading branch information
mit-mit committed Dec 13, 2022
1 parent 7211ca0 commit f5249bc
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 88 deletions.
4 changes: 1 addition & 3 deletions packages/flutter/lib/src/foundation/assertions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,7 @@ class FlutterErrorDetails with Diagnosticable {
super.debugFillProperties(properties);
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
final Diagnosticable? diagnosticable = _exceptionToDiagnosticable();
if (exception is NullThrownError) { // ignore: deprecated_member_use
properties.add(ErrorDescription('The null value was $verb.'));
} else if (exception is num) {
if (exception is num) {
properties.add(ErrorDescription('The number $exception was $verb.'));
} else {
final DiagnosticsNode errorName;
Expand Down

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions packages/flutter/test/foundation/assertions_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,6 @@ void main() {
'INFO\n'
'═════════════════════════════════════════════════════════════════\n',
);
expect(
FlutterErrorDetails(
exception: NullThrownError(), // ignore: deprecated_member_use
library: 'LIBRARY',
context: ErrorDescription('CONTEXTING'),
informationCollector: () sync* {
yield ErrorDescription('INFO');
},
).toString(),
'══╡ EXCEPTION CAUGHT BY LIBRARY ╞════════════════════════════════\n'
'The null value was thrown CONTEXTING.\n'
'\n'
'INFO\n'
'═════════════════════════════════════════════════════════════════\n',
);
expect(
FlutterErrorDetails(
exception: 'MESSAGE',
Expand Down Expand Up @@ -112,13 +97,6 @@ void main() {
'MESSAGE\n'
'═════════════════════════════════════════════════════════════════\n',
);
expect(
// ignore: deprecated_member_use
FlutterErrorDetails(exception: NullThrownError()).toString(),
'══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n'
'The null value was thrown.\n'
'═════════════════════════════════════════════════════════════════\n',
);
});

test('FlutterErrorDetails.toStringShort', () {
Expand Down
11 changes: 0 additions & 11 deletions packages/flutter/test/foundation/isolates_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,4 @@ void main() {
'_compute_caller_invalid_message.dart');
});
}, skip: kIsWeb); // [intended] isn't supported on the web.

group('compute() works with unsound null safety caller', () {
test('returning', () async {
await expectFileSuccessfullyCompletes(
'_compute_caller_unsound_null_safety.dart', true);
});
test('erroring', () async {
await expectFileSuccessfullyCompletes(
'_compute_caller_unsound_null_safety_error.dart', true);
});
}, skip: kIsWeb); // [intended] isn't supported on the web.
}

0 comments on commit f5249bc

Please sign in to comment.