Unexpected token ILLEGAL
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.1k
- Forks
- 772
- PR merge metrics
- No merged PRs in 30d
Description
Esprima 4.0.1 fails to parse the attached JS file. From my understanding it looks like Esprima fails on the following statement which contains a line break inside a string:
e.push('<div class="div-contain"><div class="divider"></div></div
><dt>' + l + "</dt>" + d.createA(m, "opt " + g, h))
The error message is Line 11: Unexpected token ILLEGAL
esprima.parse(<code from bootstrap-select.min.js.txt>, { tolerant: true });
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the esprima.parse call from the issue against bootstrap-select.min.js.txt and inspect the reported line 11, especially the line break inside the string. Trace the parser behavior for that input and establish a regression check; done means the attached JavaScript no longer produces Unexpected token ILLEGAL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100