Skip to content

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

Closed
@IdkGoodName

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 } ]

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions