code: public boolean inModuleHoistScope() {
      Node moduleRoot = getCfgRoot();
      if (moduleRoot.isFunction()) {
        // For wrapped modules, the function block is the module scope root.
        moduleRoot = moduleRoot.getLastChild();
      }
      return NodeUtil.isModuleScopeRoot(moduleRoot);
    }
docs: Determines whether the hoist scope of the current traversal is global.