fix bug in unapply for batch command

This commit is contained in:
JFH
2020-07-25 19:33:44 +02:00
parent 61b4a4accb
commit 48212c8384
2 changed files with 20 additions and 13 deletions

View File

@@ -22,7 +22,7 @@ export const HistoryEventTypes = {
/**
* Base class for commands.
*/
class Command {
export class Command {
/**
* @returns {string}
*/
@@ -434,7 +434,7 @@ export class BatchCommand extends Command {
*/
unapply (handler) {
super.unapply(handler, () => {
this.stack.forEach((stackItem) => {
this.stack.reverse().forEach((stackItem) => {
console.assert(stackItem, 'stack item should not be null');
stackItem && stackItem.unapply(handler);
});