code: private void updateGlobalNameDeclarationAtStaticMemberNode(
        Name n, String alias, boolean canCollapseChildNames) {
  
      Ref declaration = n.getDeclaration();
      Node classNode = declaration.getNode().getGrandparent();
      checkState(classNode.isClass(), classNode);
      Node enclosingStatement = NodeUtil.getEnclosingStatement(classNode);
  
      if (canCollapseChildNames) {
        addStubsForUndeclaredProperties(n, alias, enclosingStatement.getParent(), classNode);
      }
  
      // detach `static m() {}` from `class Foo { static m() {} }`
      Node memberFn = declaration.getNode().detach();
      Node fnNode = memberFn.getOnlyChild().detach();
      checkForHosedThisReferences(fnNode, memberFn.getJSDocInfo(), n);
  
      // add a var declaration, creating `var Foo$m = function() {}; class Foo {}`
      Node varDecl = IR.var(NodeUtil.newName(compiler, alias, memberFn), fnNode).srcref(memberFn);
      enclosingStatement.getParent().addChildBefore(varDecl, enclosingStatement);
      compiler.reportChangeToEnclosingScope(varDecl);
  
      // collapsing this name's properties requires updating this Ref
      n.updateRefNode(declaration, varDecl.getFirstChild());
    }
docs: Updates the first initialization (a.k.a "declaration") of a global name that occurs in a static
  MEMBER_FUNCTION_DEF in a class. See comment for {@link #updateGlobalNameDeclaration}.
  
  @param n A static MEMBER_FUNCTION_DEF in a class assigned to a global name (e.g. `a.b`)
  @param alias The new flattened name for `n` (e.g. "a$b")
  @param canCollapseChildNames whether properties of `n` are also collapsible, meaning that any
  properties only assigned locally need stub declarations