Don't consider 'google' to be a Closurized namespace
@@ -417,9 +417,15 @@ public class CheckRequiresForConstructors implements HotSwapCompilerPass, NodeTr
private void maybeAddClosurizedNamespace(String requiredName) {
if (mode == Mode.SINGLE_FILE) {
String rootName = Splitter.on('.').split(requiredName).iterator().next();
+ if (rootName.equals("google")) {
+ // Unfortunately, it's common to goog.require some things from the namespace 'google' while
+ // other things under 'google' are provided in externs. So don't consider 'google' to be
+ // a Closurized namespace.
+ } else {
closurizedNamespaces.add(rootName);
}
}
+ }
private void visitForwardDeclare(String namespace, Node forwardDeclareCall, Node parent) {
// For now, we just treat this as though it were a goog.require. There are lots of forward
