Skip to content

Commit

Permalink
share locals between branches, from review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Dec 14, 2024
1 parent bae93b4 commit 7b46ff4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dev/core/src/com/google/gwt/dev/jjs/impl/GwtAstBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -545,15 +545,13 @@ public void endVisit(BreakStatement x, BlockScope scope) {
@Override
public void endVisit(YieldStatement x, BlockScope scope) {
try {
SourceInfo info = makeSourceInfo(x);
JExpression expression = pop(x.expression);
if (x.switchExpression == null) {
// This is an implicit 'yield' in a case with an arrow - synthesize a break instead and
// wrap with a block so that the child count in JDT and GWT matches.
SourceInfo info = makeSourceInfo(x);
JExpression pop = pop(x.expression);
push(new JBlock(info, pop.makeStatement(), new JBreakStatement(info, null)));
push(new JBlock(info, expression.makeStatement(), new JBreakStatement(info, null)));
} else {
SourceInfo info = makeSourceInfo(x);
JExpression expression = pop(x.expression);
push(new JYieldStatement(info, expression));
}
} catch (Throwable e) {
Expand Down

0 comments on commit 7b46ff4

Please sign in to comment.