@@ -131,12 +131,6 @@ private Node visit(AstNode astNode, FeatureContext context, @Nullable Node sourc
131
131
return n ;
132
132
}
133
133
int children = astNode .getChildCount ();
134
- // TODO - b/388559434: remove this special case once SWITCH_BODY serialization is released.
135
- if (n .isSwitch ()
136
- && (children == 1 || astNode .getChild (1 ).getKind () != NodeKind .SWITCH_BODY )) {
137
- deserializeSwitchTemporary (astNode , n , newContext , sourceFileTemplate );
138
- return n ;
139
- }
140
134
141
135
for (int i = 0 ; i < children ; i ++) {
142
136
AstNode child = astNode .getChild (i );
@@ -148,26 +142,6 @@ private Node visit(AstNode astNode, FeatureContext context, @Nullable Node sourc
148
142
return n ;
149
143
}
150
144
151
- private void deserializeSwitchTemporary (
152
- AstNode astNode , Node switchNode , FeatureContext newContext , Node sourceFileTemplate ) {
153
- // handle deserialization of switch nodes using an older AST format, where instead of a
154
- // SWITCH_BODY node, the cases are directly children of the SWITCH node.
155
- AstNode condition = astNode .getChild (0 );
156
- Node deserializedCondition = this .visit (condition , newContext , sourceFileTemplate );
157
- this .owner ().setOriginalNameIfPresent (condition , deserializedCondition );
158
- Node switchBody = new Node (Token .SWITCH_BODY ).srcref (switchNode );
159
-
160
- switchNode .addChildToBack (deserializedCondition );
161
- switchNode .addChildToBack (switchBody );
162
-
163
- int children = astNode .getChildCount ();
164
- for (int i = 1 ; i < children ; i ++) {
165
- AstNode caseChild = astNode .getChild (i );
166
- Node deserializedCaseChild = this .visit (caseChild , newContext , sourceFileTemplate );
167
- switchBody .addChildToBack (deserializedCaseChild );
168
- }
169
- }
170
-
171
145
private void recordScriptFeatures (FeatureContext context , Node node ) {
172
146
switch (node .getToken ()) {
173
147
case FUNCTION :
0 commit comments