Menu

#47 trailling slash in regex literal looks like a comment

open
nobody
None
5
2008-06-26
2008-06-26
No

Given:
if (/\*\//.test("*/")) alert("!");

sees this as the start of a single-line comment:
//.test("*/")) alert("!");

Discussion

  • Michael Mathews

    Michael Mathews - 2008-06-26

    Fix for this specific problem, but in general the design of codepress is likely to fail on things like // in a string, and probably other places.

     
  • Michael Mathews

    Michael Mathews - 2008-06-26

    Logged In: YES
    user_id=263241
    Originator: YES

    File Added: javascript.patch

     

Log in to post a comment.