There was an error while loading. Please reload this page.
1 parent a7bd3cd commit c8d515cCopy full SHA for c8d515c
1 file changed
acorn/src/state.js
@@ -32,13 +32,14 @@ export class Parser {
32
// Set up token state
33
34
// The current position of the tokenizer in the input.
35
+ this.curLine = 1
36
if (startPos) {
37
this.pos = startPos
38
this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1
- this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length
39
+ if (this.options.locations)
40
+ this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length
41
} else {
42
this.pos = this.lineStart = 0
- this.curLine = 1
43
}
44
45
// Properties of the current token:
0 commit comments