Loading ...
Sorry, an error occurred while loading the content.

Re: Controlling compressors

Expand Messages
  • sandyhead25
    I have found the following code works in both my Pretty Diff application and the JSLint tool: /*prettydiff.com api.topcoms: true*/ /*license here*/ var a;
    Message 1 of 6 , Aug 8, 2012
    • 0 Attachment
      I have found the following code works in both my Pretty Diff application and the JSLint tool:



      /*prettydiff.com api.topcoms: true*/
      /*license here*/

      var a; //arbitrary code here

      /*throw away comment here*/

      var b;



      I would have thought JSLint would throw an error for multiple uses of the "var" keyword in any single scope, but apparently not in the global scope.

      Austin

      --- In jslint_com@yahoogroups.com, Tom Worster <fsb@...> wrote:
      >
      > Some compressors do not touch the initial comments of a file in order to
      > leave copyright, license etc. in place. I find that useful. However, some
      > of my files have comments after the public notices but before the first
      > lines of actual script that I would prefer to not see in the compressed
      > file. I can do that by separating these two passages of comments with a
      > bit of JS code.
      >
      > But I haven't come up with a separator that has no other purpose or effect
      > that both I and JSLint like.
      >
      > What's a JSLint-friendly bit of trivial code for this purpose?
      >
    • Tom Worster
      ... i don t know. ... one redundant ; does not amount filling a source file with garbage code. tolerating it and the resulting JSList warning remains an
      Message 2 of 6 , Aug 8, 2012
      • 0 Attachment
        On 8/8/12 10:11 AM, "Jakob Kruse" <kruse@...> wrote:

        >This is very compressor specific, is it not?

        i don't know.


        >Both comments would be removed (regardless of your choice of snippet) by
        >JSMin and YUI Compressor for instance, but with YUI Compressor you can
        >prevent the removal of any comment by starting it with "/*!". This seems
        >like a much better idea than filling your source files with garbage code,
        >IMHO.

        one redundant ; does not amount filling a source file with garbage code.
        tolerating it and the resulting JSList warning remains an option.
      Your message has been successfully submitted and would be delivered to recipients shortly.