bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19397: incorrect handling of / in a character class in js-mode


From: Stefan Monnier
Subject: bug#19397: incorrect handling of / in a character class in js-mode
Date: Tue, 23 Dec 2014 10:54:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> Try to type the following code in a JS buffer:
> function test ()
> {
>     return /[/]/.test ('/')
> }

Indeed, there are two problems here: js-mode treats the first / as
a division operation, and even if you change the code to avoid this
problem, you bump into the fact that js-mode doesn't know there can be
"unescaped / in character class".

I installed a fix for the first problem into emacs-24.
For the second problem, I recommend you escape the slash for now (IIUC
the syntax of regexps in ecmascript, that will DTRT).


        Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]