[cfe] Fix printing of catch clauses with new CatchVariables
Since `CatchVariable`s don't have initializers, the print method in the `Catch` node shouldn't attempt to print it. Part of https://github.com/dart-lang/sdk/issues/61572 Change-Id: I548e80e0f95c20a0537392faccd5c1fc11d844d2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497980 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
This commit is contained in:
@@ -1326,6 +1326,7 @@ class Catch extends TreeNode implements ScopeProvider {
|
||||
printer.writeVariableInitialization(
|
||||
exception!,
|
||||
includeModifiersAndType: false,
|
||||
includeInitializer: false,
|
||||
);
|
||||
if (stackTrace != null) {
|
||||
printer.write(', ');
|
||||
|
||||
Reference in New Issue
Block a user