9468f60aac
In the flattened control flow state machine generated for dart2js and ddc async functions, there is a single error state variable per function. However, functions can have nested error handling that may try to access stacked errors separately. When we enter a nested try/catch we should avoid clobbering the outer exception as the outer handler may need it later. To fix this we maintain a stack of errors that we 'push' to when we enter a new try/catch and which we 'pop' from at the end of executing that try/catch. Fixes: https://github.com/dart-lang/sdk/issues/57046 Change-Id: Ib96a44ab4152f6f9e444f2ee959ec9aa252800f9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395580 Reviewed-by: Mayank Patke <fishythefish@google.com> Commit-Queue: Nate Biggs <natebiggs@google.com>