GNU bug report logs - #26070
26.0.50; js-mode slash insertion bug

Previous Next

Package: emacs;

Reported by: Richard Copley <rcopley <at> gmail.com>

Date: Sun, 12 Mar 2017 10:25:02 UTC

Severity: normal

Found in version 26.0.50

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 26070 <at> debbugs.gnu.org (full text, mbox):

From: Richard Copley <rcopley <at> gmail.com>
To: Tom Tromey <tom <at> tromey.com>
Cc: 26070 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#26070: 26.0.50; js-mode slash insertion bug
Date: Sun, 19 Mar 2017 11:22:32 +0000
On 14 March 2017 at 11:06, Tom Tromey <tom <at> tromey.com> wrote:
>>>>>> "Dmitry" == Dmitry Gutov <dgutov <at> yandex.ru> writes:
>
>>> I think once js-syntax-propertize is called, the regexp should always
>>> succeed, so this patch makes the trailing "/" optional.
>
> Dmitry> Does it solve the infloop in the case like:
> Dmitry> /x[
> Dmitry> as well?
>
> Yes, with the patch I don't get an infloop no matter which way I insert
> those characters.
>
> Tom

Caught one!

Insert the text below in a JS-mode buffer, go to the beginning of the
blank first line in function h() and type "/". There is an infloop.

The infloop doesn't happen if the "/" in function g() is changed to
a different operator.

You can replace the 0s with other stuff, but you need at least that
many characters (delete a 0 or a space and there is no infloop).

function f() {
    function g()
    {
        1 / 2;
    }

    function h() {

        00000000000000000000000000000000000000000000000000;
        00000000000000000000000000000000000000000000000000;
        00000000000000000000000000000000000000000000000000;
        00000000000000000000000000000000000000000000000000;
        00000000000000000000000000000000000000000000000000;
        00000000000000000000000000000000000000000000000000;
        00000000000000000000000000000000000000000000000000;
        00000000000000000000000000000000000000000000000000;
        00;
    }
}




This bug report was last modified 8 years and 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.