Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JavaScript] Fix incorrect this.channel access #4570

Merged
merged 1 commit into from Apr 1, 2024

Conversation

Phlosioneer
Copy link
Contributor

BufferedTokenStream::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.

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 <mattmdrr2@gmail.com>
@ericvergnaud
Copy link
Contributor

Pfff!! How did this one survive 10 years ? Thanks!

@ericvergnaud ericvergnaud merged commit 2244af3 into antlr:dev Apr 1, 2024
40 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants