Closed mraleph closed 6 days ago
I think your program maybe should have:
print('Caught: $e');
instead of:
print(e);
to produce the output you gave?
@mnordine good catch :) fixed it.
@mraleph Your initial assessment was right, dart2js's async control flow state machine is keeping a single 'error' variable per async function. If we nest error handlers then the inner handler will clobber the value already set by the outer one.
I have a fix that I'm verifying: https://dart-review.googlesource.com/c/sdk/+/395580 The fix keeps a stack of errors rather than a single error variable and pushes/pops as we enter/exit error handling scopes.
The following code shows different behavior on the Web and on the VM. It seems in dart2js case exception thrown from
(*)
is clobbering the exception which is currently in flight.DDC might also have a problem with desugarring but of a different nature because in DartPad I get unhandled
StateError
./cc @natebiggs