Closed nexushoratio closed 9 months ago
Hi! Not sure from which version you upgraded -- the affected code has been there for a number of years now.
I can also reproduce the same error without IIFE, just with use strict
and a static block inside a class.
Anyway, I've pushed a change which should hopefully serve as a good enough workaround, see if you still have problems.
Thanks. I'll give it a try as soon as I can and report back.
FTR, I downgraded to 20230408 and I had no problems with long pauses or error messages. I did experience the issue expressed in #594 .
Ahh, noticed it was on melpa already.
Works great. Many thanks!
I downgraded to 20230408 and I had no problems with long pauses or error messages
Okay, that actually makes sense: there was no support for static
at that time. Though I'd expect the behavior to be the same in both of these cases: file fails to parse, shows some errors in the buffer and in Messages.
Works great. Many thanks!
Welcome!
I finally updated js2-mode and immediately noticed some problems with my existing code. It would pause/hang on every change. I managed to narrow it down to the following example:
In particular, it has to be both:
use strict
inside the functionBasically, this is a pattern I use for userscript libraries. The IIFE having a name makes debugging easier than an anonymous function.
When I load the file (or make a change, or run
js2-mode-reset
), I get the following:I do not recall which version I upgraded from, and have not yet tested to see when it was introduced, but the recent Support for static initialization blocks (https://github.com/mooz/js2-mode/issues/594). seems to be a likely candidate.
Fairly trivial .emacs file:
I still consider myself an emacs newbie, so not sure how to run with only js2-mode in an isolated enviroment to verify this is not due to some strange combination of things installed. If info is needed, pointers appreciated.
Running mainline Debian bookworm: