function saveGlobal(path, name = path.node.name) {
    // init entry if needed
    if (!globals.has(name)) {
      globals.set(name, [])
    }
    // append ref
    const refsForName = /** @type {IdentifierOrThisExpressionNodePath[]} */ (
      globals.get(name)
    )
    refsForName.push(path)
  }
@param {IdentifierOrThisExpressionNodePath} path
@param {string} [name]