Have undefined | true mean success

This commit is contained in:
Daniel Imms
2019-04-06 15:21:20 -04:00
parent d6daf40250
commit 7e36bf47c6
3 changed files with 122 additions and 173 deletions
+5 -3
View File
@@ -353,7 +353,7 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
if (this._oscHandlers[ident] === undefined) {
this._oscHandlers[ident] = [];
}
const handlerList = this._oscHandlers[ident];
const handlerList = this._oscHandlers[ident];
handlerList.push(callback);
return {
dispose: () => {
@@ -505,7 +505,8 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
const handlers = this._csiHandlers[code];
let j = handlers ? handlers.length - 1 : -1;
for (; j >= 0; j--) {
if (handlers[j](params, collect)) {
// undefined or true means success and to stop bubbling
if (handlers[j](params, collect) !== false) {
break;
}
}
@@ -590,7 +591,8 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
const handlers = this._oscHandlers[identifier];
let j = handlers ? handlers.length - 1 : -1;
for (; j >= 0; j--) {
if (handlers[j](content)) {
// undefined or true means success and to stop bubbling
if (handlers[j](content) !== false) {
break;
}
}