jawr
  1. jawr
  2. JAWR-369

Add semicolon between JavaScript files if necessary

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8
    • Fix Version/s: 3.9
    • Component/s: Jawr Core
    • Labels:
      None

      Description

      Everything works fine in debug mode but on the server JavaScript didn't work.
      I found out that i just had to add a semicolon at the end of one JavaScript file.
      When you join two JavaScript files it can be necessary to insert a semicolon between them to keep the code valid.
      It would be great if JAWR would do this automatically.

      I think this is a realy mean problem because you may not realize that you have a serious bug online because everything works fine on your devoloper pc.

        Activity

        Hide
        icefox added a comment -

        Hi,

        By default, Jawr adds a semi colon if the script doesn't ends with ')'

        I'll updated the code to add a trim before the check.

        Can you give me an example where it fails?

        Cheers,

        Show
        icefox added a comment - Hi, By default, Jawr adds a semi colon if the script doesn't ends with ')' I'll updated the code to add a trim before the check. Can you give me an example where it fails? Cheers,
        Hide
        H.Schulz added a comment -

        Sorry, I can't remember where I inserted a ; by myself to make it work.

        Show
        H.Schulz added a comment - Sorry, I can't remember where I inserted a ; by myself to make it work.
        Hide
        dtrunk90 added a comment -

        OwlCarousel < 1.3.3 had no semicolon at the end, but ended with ')': https://github.com/OwlFonk/OwlCarousel/blob/2a2843708fd018235532b31c9d67b3321fb0e652/owl-carousel/owl.carousel.min.js

        Just put it somewhere in a bundle with `bundlepostprocessors=none` as its already minified, except at the end.

        Show
        dtrunk90 added a comment - OwlCarousel < 1.3.3 had no semicolon at the end, but ended with ')': https://github.com/OwlFonk/OwlCarousel/blob/2a2843708fd018235532b31c9d67b3321fb0e652/owl-carousel/owl.carousel.min.js Just put it somewhere in a bundle with `bundlepostprocessors=none` as its already minified, except at the end.
        Hide
        icefox added a comment -

        Hi,

        Jawr adds a semi colon if there is a postprocessor.
        In the case where there are no postprocessor defined, no semicolon is added.
        Thanks for pointing this out.
        I'll fix this

        Cheers,

        Show
        icefox added a comment - Hi, Jawr adds a semi colon if there is a postprocessor. In the case where there are no postprocessor defined, no semicolon is added. Thanks for pointing this out. I'll fix this Cheers,
        Hide
        icefox added a comment -

        This issue has been fixed in the master branch

        Show
        icefox added a comment - This issue has been fixed in the master branch

          People

          • Assignee:
            icefox
            Reporter:
            H.Schulz
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: