Tapestry 5
  1. Tapestry 5
  2. TAP5-646

When Tapestry is combining JavaScript files, it should check for a JS file that ends with an unterminated comment, and add the comment terminator

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.4
    • Fix Version/s: 5.1.0.4
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      From the mailing list:

      I'm found were is the problem...

      It's appear only when tapestry.production-mode=true.
      As I'm understand in this mode all JavaScripts gather in one virtual .js.
      But one of my script have comment at the last line!!!!!
      The next script added to the end of previous one without CL, so the meaning
      line of the second script became commented...
      I'm solve the problem, but IMHO it's need to change virtual file gathering
      in order to prevent such a situation.

      To be honest, this one goes to user error, but the unterminated comment doesn't cause problems with many individual <script> tags, just with the virtual combined script, so I guess it falls in Tapestry's lap.

        Activity

        Hide
        Fernando Padilla added a comment -

        Totally makes sense that this would be the bug ( if it's true ). I would vote to me extra secure and add: "\n;"
        This way the javascript parser will definitely close any previous statement.. ( either through the return, or through the extra semi-colon ).

        Show
        Fernando Padilla added a comment - Totally makes sense that this would be the bug ( if it's true ). I would vote to me extra secure and add: "\n;" This way the javascript parser will definitely close any previous statement.. ( either through the return, or through the extra semi-colon ).
        Hide
        Piero Sartini added a comment -

        Did not check it, but my understanding of this issue was that there is an one-line comment (//) at the end of a file without the new line character ( LF on unix ).
        Tap5 needs to make sure that each file ends with NL and insert it if needed.

        Show
        Piero Sartini added a comment - Did not check it, but my understanding of this issue was that there is an one-line comment (//) at the end of a file without the new line character ( LF on unix ). Tap5 needs to make sure that each file ends with NL and insert it if needed.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development