mooz / js2-mode

Improved JavaScript editing mode for GNU Emacs
GNU General Public License v3.0
1.33k stars 186 forks source link

Omitting parentheses and identifiers of CATCH should not raise errors #573

Closed rayw000 closed 3 years ago

rayw000 commented 3 years ago

What happened

try {
    // ...
} catch {}
    //  ^ An error raises here saying `missing (  before catch-block condition`

Expected

No errors reported.

Version

Currently I'm on version 20210830.12 installed from MELPA.

Perhaps we should not strictly expect a catch identifier list here? https://github.com/mooz/js2-mode/blob/b913961e410dbfdc52a80d62eb4cfe7a305b4e3e/js2-mode.el#L9291-L9292

dgutov commented 3 years ago

Thanks for the report, should be fixed now.