espree.tokenize doesn't tokenize } if it's last token #403
Closed
Description
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 } ]