Reviewers: metaweta,
Description:
Previously,
switch (foo) {
case 1:
bar();
break;
}
would render as
switch (foo) {
case 1: {
bar();
break;
}
}
and many switch statements rendered with spurious noops.
This fixes that, and makes the switch body getter available on the
ancestor class of both default: and case: statements.
And made sure that a program consisting of only a directive prologue
does not fail to parse.
Please review this at http://codereview.appspot.com/159052
Affected files:
M src/com/google/caja/parser/js/CaseStmt.java
M src/com/google/caja/parser/js/DefaultCaseStmt.java
M src/com/google/caja/parser/js/Parser.java
M src/com/google/caja/parser/js/SwitchCase.java
M src/com/google/caja/parser/js/SwitchStmt.java
M tests/com/google/caja/parser/js/rendergolden1.txt