diff --git a/src/common/input/WriteBuffer.test.ts b/src/common/input/WriteBuffer.test.ts index ab9433da..d3dfebd0 100644 --- a/src/common/input/WriteBuffer.test.ts +++ b/src/common/input/WriteBuffer.test.ts @@ -6,6 +6,7 @@ import { assert } from 'chai'; import { WriteBuffer } from './WriteBuffer'; +// eslint-disable-next-line @typescript-eslint/naming-convention declare let Buffer: any; function toBytes(s: string): Uint8Array { diff --git a/src/common/parser/EscapeSequenceParser.test.ts b/src/common/parser/EscapeSequenceParser.test.ts index 2691836b..3b6910a6 100644 --- a/src/common/parser/EscapeSequenceParser.test.ts +++ b/src/common/parser/EscapeSequenceParser.test.ts @@ -58,6 +58,9 @@ const oscPutParser = new MockOscPutParser(); // derived parser with access to internal states class TestEscapeSequenceParser extends EscapeSequenceParser { + public get transitions(): TransitionTable { + return this._transitions; + } public get osc(): string { return (this._oscParser as MockOscPutParser).data; } @@ -192,13 +195,13 @@ describe('EscapeSequenceParser', function (): void { const parser = testParser; describe('Parser init and methods', function (): void { it('constructor', function (): void { - let p: EscapeSequenceParser = new EscapeSequenceParser(); - chai.expect(p.TRANSITIONS).equal(VT500_TRANSITION_TABLE); - p = new EscapeSequenceParser(VT500_TRANSITION_TABLE); - chai.expect(p.TRANSITIONS).equal(VT500_TRANSITION_TABLE); + let p = new TestEscapeSequenceParser(); + chai.expect(p.transitions).equal(VT500_TRANSITION_TABLE); + p = new TestEscapeSequenceParser(VT500_TRANSITION_TABLE); + chai.expect(p.transitions).equal(VT500_TRANSITION_TABLE); const tansitions: TransitionTable = new TransitionTable(10); - p = new EscapeSequenceParser(tansitions); - chai.expect(p.TRANSITIONS).equal(tansitions); + p = new TestEscapeSequenceParser(tansitions); + chai.expect(p.transitions).equal(tansitions); }); it('inital states', function (): void { chai.expect(parser.initialState).equal(ParserState.GROUND); diff --git a/src/common/parser/EscapeSequenceParser.ts b/src/common/parser/EscapeSequenceParser.ts index bc0b620e..d41b6452 100644 --- a/src/common/parser/EscapeSequenceParser.ts +++ b/src/common/parser/EscapeSequenceParser.ts @@ -253,7 +253,9 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP protected _escHandlerFb: EscFallbackHandlerType; protected _errorHandlerFb: (state: IParsingState) => IParsingState; - constructor(readonly TRANSITIONS: TransitionTable = VT500_TRANSITION_TABLE) { + constructor( + protected readonly _transitions: TransitionTable = VT500_TRANSITION_TABLE + ) { super(); this.initialState = ParserState.GROUND; @@ -471,7 +473,7 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP const dcs = this._dcsParser; let collect = this._collect; const params = this._params; - const table: Uint8Array = this.TRANSITIONS.table; + const table: Uint8Array = this._transitions.table; // process input string for (let i = 0; i < length; ++i) {