()
| 53 | // Pop commands required to undo effects as well as forward commands to shift |
| 54 | // on the command list. |
| 55 | popUndoCommands () { |
| 56 | if (this.additionalCommandStateStack.length === 0) { |
| 57 | throw new Error('There are no undo commands to undo.') |
| 58 | } |
| 59 | const undoCommands = this.additionalCommandStateStack.pop() |
| 60 | undoCommands.reverse() |
| 61 | return { |
| 62 | forwardCommands: this.undoCommandStack.pop(), |
| 63 | undoCommands |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Pushes a single undo effect command. Used to undo effect operations. |