Skip to content

Commit 2244af3

Browse files
Phlosioneerericvergnaud
authored andcommitted
Fix incorrect this.channel access
nextTokenOnChannel was accessing the field `this.channel` instead of the parameter `channel`. The buffered token stream class doesn't have a field named `channel`, so this exhausted the token buffer instead. The bug had not been caught because it is only called from `CommonTokenStream` with parameter `this.channel`. Signed-off-by: Phlosioneer <[email protected]>
1 parent 0d30259 commit 2244af3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/JavaScript/src/antlr4/BufferedTokenStream.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export default class BufferedTokenStream extends TokenStream {
253253
return -1;
254254
}
255255
let token = this.tokens[i];
256-
while (token.channel !== this.channel) {
256+
while (token.channel !== channel) {
257257
if (token.type === Token.EOF) {
258258
return -1;
259259
}

0 commit comments

Comments
 (0)