code: void forceToEs6Module(Node root) {
      if (Es6RewriteModules.isEs6ModuleRoot(root)) {
        return;
      }
      Node moduleNode = new Node(Token.MODULE_BODY).srcref(root);
      moduleNode.addChildrenToBack(root.removeChildren());
      root.addChildToBack(moduleNode);
      compiler.reportChangeToChangeScope(root);
    }
docs: Force rewriting of a script into an ES6 module, such as for imported files that contain no
  "import" or "export" statements.