Menu

#918 regex's improperly lexed in HTML/JavaScript

Bug
closed-fixed
4
2024-07-22
2010-02-20
No

in JavaScript/ECMAscript, nothing needs to precede a regex literal for it to be valid.

eg: /a|b/i is a valid regex and /a|b/i.test("baby") is valid use of it.

currently the HTML lexer differs from the JS lexer in the way they interpret regex literals, even having different preceding character requirements, it should be made uniform. i'm not sure who maintains each of these lexers, but if i have time i will try to submit a patch. might be a faster fix for someone more familiar with the codebase,

perhaps related to http://sourceforge.net/tracker/?func=detail&aid=1777016&group_id=2439&atid=102439

Leon

Discussion

  • Neil Hodgson

    Neil Hodgson - 2010-02-21
    • priority: 5 --> 4
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-accepted
     
  • Neil Hodgson

    Neil Hodgson - 2010-02-21

    Bug fixes are generally contributed by people that have sufficient need to provide them. I won't be working on this myself.

     
  • Zufu Liu

    Zufu Liu - 2022-04-09
    • labels: Scintilla --> Scintilla, lexilla, html
     
  • Zufu Liu

    Zufu Liu - 2022-04-09

    following test case can be fixed by adding > into setOKBeforeJSRE.

    <script>
    /a|b/i.test("baby");
    </script>
    
     
  • Zufu Liu

    Zufu Liu - 2024-06-02
    • labels: Scintilla, lexilla, html --> Scintilla, lexilla, html, javascript
    • status: open-accepted --> open-fixed
     
  • Zufu Liu

    Zufu Liu - 2024-06-02
     
  • Neil Hodgson

    Neil Hodgson - 2024-07-22
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB