code: private Symbol findSymbolForScope(SymbolScope scope) {
      Node rootNode = scope.getRootNode();
      if (rootNode.getParent() == null) {
        return globalScope.getSlot(GLOBAL_THIS);
      }
  
      if (!rootNode.isFunction()) {
        return null;
      }
  
      String name = NodeUtil.getBestLValueName(NodeUtil.getBestLValue(rootNode));
      return name == null ? null : scope.getParentScope().getQualifiedSlot(name);
    }
docs: Find the symbol associated with the given scope. Notice that we won't always be able to figure
  out this association dynamically, so sometimes we'll just create the association when we create
  the scope.