-
Notifications
You must be signed in to change notification settings - Fork 382
Open
Description
An old TODO in Simplifier suggests a change to how the GWT AST is built that makes some operations easier:
gwt/dev/core/src/com/google/gwt/dev/jjs/impl/Simplifier.java
Lines 282 to 285 in 58a69dd
| // Force sub-parts to blocks, otherwise we break else-if chains. | |
| // TODO: this goes away when we normalize the Java AST properly. | |
| thenStmt = ensureBlock(thenStmt); | |
| elseStmt = ensureBlock(elseStmt); |
This should not impact JS at all, and a quick draft suggests that this will also be possible without changing the string representation of the GWT ast as well.
Since JIfStatement has no setters, the only way to rewrite its then/else statements is presently with a specialized visitor that only handles the top-level statement it finds. By implementing this change, we can also add/remove statements in either branch by just modifying the block's contents.
Metadata
Metadata
Assignees
Labels
No labels