Skip to content
Myr

Wrap emit to preserve callback order when async (#1638)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by John Gee · committed by GitHub · parent e649291 · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:lib/command.js+5 added-1 removed
1223 unmodified lines
12241225 let actionResult;1226 actionResult = this._chainOrCallHooks(actionResult, 'preAction');1227 actionResult = this._chainOrCall(actionResult, () => this._actionHandler(this.processedArgs));1228 if (this.parent) {1229 actionResult = this._chainOrCall(actionResult, () => {1228 if (this.parent) this.parent.emit(commandEvent, operands, unknown); // legacy1230 this.parent.emit(commandEvent, operands, unknown); // legacy1231 });1232 }1233 actionResult = this._chainOrCallHooks(actionResult, 'postAction');1234 return actionResult;1235 }1236 if (this.parent && this.parent.listenerCount(commandEvent)) {
712 unmodified lines