|
From: | Jackson Ray Hamilton |
Subject: | bug#45717: 27.1; Error with apostrophe in JSX comment |
Date: | Fri, 19 Nov 2021 18:32:06 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
Hi, thanks for bringing this to our attention.This code seems to throw js-jsx--syntax-propertize-extend-region into an infinite loop. M-x toggle-debug-on-error and M-x eval-expression (js-jsx--syntax-propertize-extend-region 69 240) shows the stack trace; (backward-sexp) ultimately causes (syntax-propertize), thus the loop.
Using M-x edebug-defun to debug js-jsx--syntax-propertize-extend-region, after pressing space a bunch of times to step through it, I see it’s trying to jump from “)}” to the “{” in “className={”. The presence of the apostrophe somehow interrupts the intended logic.
I tried adding parse-sexp-ignore-comments to the let and it suppressed the infinite loop but caused a scan-error (which is immediately caught) which seems wrong to me.
I tried adding (parse-sexp-ignore-comments t) to the let and encountered another infinite loop.
Tricky. For now, I’ll leave the mailing list with my notes. On 11/2/21 6:34 PM, Dmitry Gutov wrote:
On 31.10.2021 05:41, Stefan Kangas wrote:tags 45717 + confirmed thanks Jakobsson Mattias<mattias.jakobsson@smhi.se> writes:I get the errors in the Recent messages further below if I edit (e.g., by inserting a newline) a JSX file with the content between the ``` below. If I remove the apostrophe from"don't" in the comment the errors goes away. ``` import React from "react"; const MyComponent = ({ someList }) => ( <div className={someList.filter( // don't include an apostrophe in this comment (cls) => cls !== "someclass" )} /> ); export default MyComponent; ```I tried reproducing this on current master, but I don't see any message. However, I do see incorrect highlighting after the comment with the apostrophe, so something is clearly still not working as it should.I do see errors in this scenario, especially after trying to edit or move around. Like:js-jsx--syntax-propertize-extend-region: Lisp nesting exceeds ‘max-lisp-eval-depth’Error during redisplay: (jit-lock-function 1) signaled (error "Lisp nesting exceeds ‘max-lisp-eval-depth’")Adding Jackson to Cc, perhaps he'll have time and inclination to investigate this.
[Prev in Thread] | Current Thread | [Next in Thread] |