code: public static boolean isInClosurizedFile(Node node, NodeMetadata metadata) {
      Node script = NodeUtil.getEnclosingScript(node);
  
      if (script == null) {
        return false;
      }
  
      Node child = script.getFirstChild();
      while (child != null) {
        if (NodeUtil.isExprCall(child)) {
          if (Matchers.googRequire().matches(child.getFirstChild(), metadata)) {
            return true;
          }
          // goog.require or goog.module.
        } else if (child.isVar() && child.getBooleanProp(Node.IS_NAMESPACE)) {
          return true;
        }
        child = child.getNext();
      }
      return false;
    }
docs: Looks for a goog.require(), goog.provide() or goog.module() call in the node's file.