whole_func_string: function addState(name, state) {
      if (states[name])
        throw new Error('A state already exist in the router with the name ' + name)
  
      state = stateTree(state)
  
      states[name] = state
  
      // The router is already initialized: Hot patch this state in.
      if (initialized) {
        state.init(router, name)
        registerLeafStates([state], leafStates)
      }
  
      return router
    }
func_code_string: function addState(name, state) {
      if (states[name])
        throw new Error('A state already exist in the router with the name ' + name)
  
      state = stateTree(state)
  
      states[name] = state
  
      // The router is already initialized: Hot patch this state in.
      if (initialized) {
        state.init(router, name)
        registerLeafStates([state], leafStates)
      }
  
      return router
    }
func_documentation_string: /*
  Add a new root state to the router.
  The name must be unique among root states.