fa5e12d50a791ed137fd883b4f373da597eaf34b
For isolates spawned by the application via `Isolate.spawn()`ed, the VM will create a "lightweight" isolate and invoke the `initialize_isolate` embedder callback to initialize it. The embedder-provided callback will be invoked with the active isolate and is expected to return with that active isolate - irrespective of whether it succeeded to initialize or not. => The unsuccessful path was using `Dart_ExitIsolate()` - which is incorrect. This PR fixes that by not exiting the isolate. As a side-effect of the fix, we also do less `Dart_EnterIsolate()`/`Dart_ExitIsolate()` calls in initialization (which makes it faster) and handle failure to spawn the root isolate. Furthermore this PR removes some dead code and replaces it with `FML_DCHECK()`s instead. The PR adds a test that will set the root library to null which will make the engine fail initializing of the isolate and therefore trigger this error handling path. Fixes https://github.com/flutter/flutter/issues/90478
Fix incorrect handling of error handling in case an isolate initialization fails (flutter/engine#31207)
Description
Languages
Dart
75.4%
C++
16.4%
Objective-C++
2.7%
Java
2.7%
Objective-C
0.6%
Other
1.8%