Skip to content

Commit 58c132e

Browse files
lauraharkercopybara-github
authored andcommitted
Remove obsolete null check for JSDoc on a closureUnaware script
PiperOrigin-RevId: 900179148
1 parent 3fedc00 commit 58c132e

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/com/google/javascript/jscomp/TranspileAndOptimizeClosureUnaware.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.javascript.jscomp;
1818

19+
import static com.google.common.base.Preconditions.checkNotNull;
1920
import static com.google.common.base.Preconditions.checkState;
2021

2122
import com.google.common.collect.ImmutableList;
@@ -76,12 +77,8 @@ public boolean shouldTraverse(NodeTraversal t, Node n, Node parent) {
7677
if (!n.isClosureUnawareCode()) {
7778
return false;
7879
}
79-
JSDocInfo fileJsDoc = n.getJSDocInfo();
80-
if (fileJsDoc == null || fileJsDoc.getPerFileClosureUnawareMode() == null) {
81-
// TODO: b/475302905 - remove this null check, once the JSC release to always serialize a
82-
// ClosureUnawareMode lands.
83-
return true;
84-
}
80+
JSDocInfo fileJsDoc =
81+
checkNotNull(n.getJSDocInfo(), "closure unaware script must have JSDoc, found %s", n);
8582
var minificationLevel = fileJsDoc.getPerFileClosureUnawareMode();
8683
return switch (minificationLevel) {
8784
case UNSPECIFIED, SIMPLE -> true;

0 commit comments

Comments
 (0)