set member through ctor argument

This commit is contained in:
Jörg Breitbart
2018-05-01 20:33:48 +02:00
parent c7fdff2f40
commit 728eeebcc7
2 changed files with 5 additions and 6 deletions
+1 -3
View File
@@ -200,7 +200,6 @@ class DcsDummy implements IDcsHandler {
export class EscapeSequenceParser implements IEscapeSequenceParser {
public initialState: number;
public currentState: number;
readonly transitions: TransitionTable;
// buffers over several parse calls
// FIXME: make those protected (needs workaround in tests)
@@ -227,10 +226,9 @@ export class EscapeSequenceParser implements IEscapeSequenceParser {
protected _dcsHandlerFb: IDcsHandler;
protected _errorHandlerFb: (state: IParsingState) => IParsingState;
constructor(transitions: TransitionTable = VT500_TRANSITION_TABLE) {
constructor(readonly transitions: TransitionTable = VT500_TRANSITION_TABLE) {
this.initialState = ParserState.GROUND;
this.currentState = this.initialState;
this.transitions = transitions;
this.osc = '';
this.params = [0];
this.collect = '';
+4 -3
View File
@@ -25,11 +25,12 @@ const GLEVEL = {'(': 0, ')': 1, '*': 2, '+': 3, '-': 1, '.': 2};
* each function's header comment.
*/
export class InputHandler implements IInputHandler {
private _parser: EscapeSequenceParser;
private _surrogateHigh: string;
constructor(private _terminal: any) {
this._parser = new EscapeSequenceParser; // FIXME: maybe as ctor argument
constructor(
private _terminal: any,
private _parser: EscapeSequenceParser = new EscapeSequenceParser)
{
this._surrogateHigh = '';
/**