SyntaxError: catch variable already exists

Open
#40 4 comments 0 reactions 0 assignees View on GitHub

@kasperisager is already working on this.

Since Jun 7, 2026.

  • #74 by @kasperisager — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, javascript
Domain
compilers

Research direction

Start by running the reported mqjs --eval command and compare its behavior with the expected handling of repeated catch-variable names. Trace the --eval entry point into the parser or syntax-error handling; done means the behavior is consistent with the intended JavaScript semantics and the regression is covered by a test.

Written by the indexing model from the issue text.

Description

This seems unexpected to me. Is it?

mqjs --eval "try {} catch (A) {}; try {} catch (A) {}"

results in

SyntaxError: catch variable already exists
    at <cmdline>:1:36
Dominant language
C
Stars
6.2k
Forks
251
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from bellard/mquickjs

All issues in bellard/mquickjs

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.