Remove input and length from state (#9646)

This commit is contained in:
Daniel Tschinder
2019-03-11 00:42:42 -07:00
committed by GitHub
parent ec318d01fa
commit cf4bd8bb8d
11 changed files with 147 additions and 182 deletions

View File

@@ -23,9 +23,6 @@ type TopicContextState = {
export default class State {
strict: boolean;
input: string;
length: number;
curLine: number;
// And, if locations are used, the {line, column} object
@@ -33,13 +30,10 @@ export default class State {
startLoc: Position;
endLoc: Position;
init(options: Options, input: string): void {
init(options: Options): void {
this.strict =
options.strictMode === false ? false : options.sourceType === "module";
this.input = input;
this.length = input.length;
this.curLine = options.startLine;
this.startLoc = this.endLoc = this.curPosition();
}