jquery / jquery/esprima

Unexpected token ILLEGAL

Open
#1,964 0 comments 0 reactions 0 assignees View on GitHub

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 });

bootstrap-select.min.js.txt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.