Skip to content

Commit b3bc455

Browse files
lauraharkercopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 716235462
1 parent 314f7fa commit b3bc455

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/com/google/javascript/jscomp/serialization/ScriptNodeDeserializer.java

-26
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,6 @@ private Node visit(AstNode astNode, FeatureContext context, @Nullable Node sourc
131131
return n;
132132
}
133133
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-
}
140134

141135
for (int i = 0; i < children; i++) {
142136
AstNode child = astNode.getChild(i);
@@ -148,26 +142,6 @@ private Node visit(AstNode astNode, FeatureContext context, @Nullable Node sourc
148142
return n;
149143
}
150144

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-
171145
private void recordScriptFeatures(FeatureContext context, Node node) {
172146
switch (node.getToken()) {
173147
case FUNCTION:

0 commit comments

Comments
 (0)