Files
sdk/pkg/testing/lib
Jens Johansen f3740c96e8 [package:testing] Reset the isolates errors fatal option
This code

```
import 'dart:isolate';

Future<void> main([List<String> arguments = const []]) async {
  await something();
  print("After the call!");
  if (1+1==2) throw "This will be swallowed";
  print("This will never be printed.");
}

Future<void> something() async {
  Isolate.current.setErrorsFatal(false);
}
```

prints

```
$ out/ReleaseX64/dart pkg/front_end/test/fasta/hmm.dart
After the call!
$ echo $?
0
```

I.e. it dies silently, swallowing the throw and has a 0 exit code.

Using package:testing (and having it run at least one thing), it
previously did this so that if anything crashed, say, in user code
after the run (or maybe even some places inside package:testing?) it
would just swallow the error and leave a 0 exit code.
This CL sets the errors fatal thing to true (which must be the default)
causing the normal behaviour of it not swallowing any throws.

Change-Id: I9850bbf504e172cc4077e5e17265833ef58dfe90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350321
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-02-05 14:38:05 +00:00
..