Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6680

JavaScriptStripper chokes on template literals that contain two forward slashes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 8.5.0, 9.0.0-M2, 7.14.0
    • 8.6.1, 7.15.0, 9.0.0-M3
    • wicket-core
    • None

    Description

      The DefaultJavaScriptCompressor uses the JavaScriptStripper to strip comments and whitespace from javascript code when running in production mode, but it has no support for / understanding of template literals. As such, it chokes on the following snippet

      const url = `${protocol}//${hostname}:${port}`;

       as it identifies the two forward slashes as the beginning of a single-line comment, and removes the code after it, breaking the javascript.

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            a.bogaart Arthur Bogaart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: