File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -775,7 +775,8 @@ mixin PieceFactory {
775775 pieces.token (catchKeyword);
776776 pieces.space ();
777777
778- var parameters = DelimitedListBuilder (this );
778+ var parameters = DelimitedListBuilder (
779+ this , const ListStyle (commas: Commas .nonTrailing));
779780 parameters.leftBracket (catchClause.leftParenthesis! );
780781 if (catchClause.exceptionParameter case var exceptionParameter? ) {
781782 parameters.visit (exceptionParameter);
Original file line number Diff line number Diff line change @@ -110,4 +110,33 @@ try {
110110} on FooException {
111111} on BarException {
112112 doSomething();
113- }
113+ }
114+ >>> Split inside catch clause without stack trace.
115+ try {
116+ doSomething();
117+ } catch (someSurprisinglyLongVariableName) {
118+ doSomething();
119+ }
120+ <<<
121+ try {
122+ doSomething();
123+ } catch (
124+ someSurprisinglyLongVariableName
125+ ) {
126+ doSomething();
127+ }
128+ >>> Split inside catch clause with stack trace.
129+ try {
130+ doSomething();
131+ } catch (longErrorVariable, longStackTrace) {
132+ doSomething();
133+ }
134+ <<<
135+ try {
136+ doSomething();
137+ } catch (
138+ longErrorVariable,
139+ longStackTrace
140+ ) {
141+ doSomething();
142+ }
Original file line number Diff line number Diff line change 2727 body;
2828} catch (
2929 // comment
30- e,
30+ e
3131) {
3232 print(e);
3333}
@@ -38,7 +38,7 @@ try { body; } catch (e// comment
3838try {
3939 body;
4040} catch (
41- e, // comment
41+ e // comment
4242) {
4343 print(e);
4444}
You can’t perform that action at this time.
0 commit comments