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

espree.tokenize doesn't tokenize } if it's last token #403

Closed
IdkGoodName opened this issue Nov 21, 2018 · 5 comments
Closed

espree.tokenize doesn't tokenize } if it's last token #403

IdkGoodName opened this issue Nov 21, 2018 · 5 comments

Comments

@IdkGoodName
Copy link

Espree doesn't tokenize }

espree.tokenize('{}') // 1st
espree.tokenize('}') // 2nd
espree.tokenize('{}?') // 3rd
espree.tokenize('{\n}}') // 4th

output is:

// 1st
[ Token { type: 'Punctuator', value: '{', start: 0, end: 1 } ]
// 2nd
[]
// 3rd
[ Token { type: 'Punctuator', value: '{', start: 0, end: 1 },
  Token { type: 'Punctuator', value: '}', start: 1, end: 2 },
  Token { type: 'Punctuator', value: '?', start: 2, end: 3 } ]
// 4th
[ Token { type: 'Punctuator', value: '{', start: 0, end: 1 },
  Token { type: 'Punctuator', value: '}', start: 2, end: 3 } ]
@platinumazure
Copy link
Member

Hi @CreatorVilius, thanks for the issue.

Can you please share what version of espree you're using? Thanks!

@IdkGoodName
Copy link
Author

I am using 4.1.0.

@not-an-aardvark
Copy link
Member

I can reproduce this issue.

@platinumazure
Copy link
Member

@not-an-aardvark Is this still an issue?

@not-an-aardvark
Copy link
Member

Yes, I can still reproduce it on master.

finico pushed a commit to finico/espree that referenced this issue Jul 30, 2019
finico pushed a commit to finico/espree that referenced this issue Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants