addSubCommand (cmd) {
    console.assert(cmd !== null, 'cmd should not be null')
    this.stack.push(cmd)
  }
Adds a given command to the history stack.
@param {Command} cmd - The undo command object to add
@returns {void}