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

RE: [jslint] "use strict";

Expand Messages
  • Sean Kelly
    I m new to this list so this may have been answered before but aside from reading the source code to JSLint (thanks BTW), how do we go about understanding
    Message 1 of 6 , Sep 16, 2010
    • 0 Attachment
      I'm new to this list so this may have been answered before but aside from
      reading the source code to JSLint (thanks BTW), how do we go about
      understanding exactly what strict mode does? The questions on stackoverflow
      are kind of mixed and I didn't remember seeing any discussion of this on
      jslint.com

      SeanK
      P.S. I also started programming in JavaScript without learning the language.
      I am attempting to fix that now.



      *From:* jslint_com@yahoogroups.com [mailto:jslint_com@yahoogroups.com] *On
      Behalf Of *douglas@...
      *Sent:* Thursday, September 16, 2010 1:54 PM
      *To:* jslint_com@yahoogroups.com
      *Subject:* [jslint] "use strict";





      JSLint is now doing more checking of strict mode code.

      Use of strict mode is highly recommended, but do not use strict mode unless
      you fully understand what it does. Strict mode, by design, will break
      programs.

      Do not concatenate strict mode and non-strict mode code together. Doing so
      can cause the non-strict code to fail.



      .




      [Non-text portions of this message have been removed]
    • Cheney, Edward A SSG RES USAR
      Where does the use strict declaration go? Does it go at the top of a JavaScript file, or at the top of a function, or both, or somewhere else? Thanks,
      Message 2 of 6 , Sep 17, 2010
      • 0 Attachment
        Where does the "use strict" declaration go? Does it go at the top of a JavaScript file, or at the top of a function, or both, or somewhere else?

        Thanks,
        Austin
      • Dominic Mitchell
        On Fri, Sep 17, 2010 at 8:43 AM, Cheney, Edward A SSG RES USAR
        Message 3 of 6 , Sep 17, 2010
        • 0 Attachment
          On Fri, Sep 17, 2010 at 8:43 AM, Cheney, Edward A SSG RES USAR <
          austin.cheney@...> wrote:

          > Where does the "use strict" declaration go? Does it go at the top of a
          > JavaScript file, or at the top of a function, or both, or somewhere else?
          >

          It must be the very first statement in a file. I'm sure that jslint will
          tell you this. :)

          -Dom


          [Non-text portions of this message have been removed]
        • Morgaut Alexandre Louis Marc
          It may also be at set as the first line of a JavaScript function so even if the rest of the code (after concatenation or loaded from other tags)
          Message 4 of 6 , Sep 17, 2010
          • 0 Attachment
            It may also be at set as the first line of a JavaScript function

            so even if the rest of the code (after concatenation or loaded from other <script> tags) doesn't run in strict mode, the code of this function should

            (not sure it will be supported soon)

            On Sep 17, 2010, at 10:23 AM, Dominic Mitchell wrote:

            > On Fri, Sep 17, 2010 at 8:43 AM, Cheney, Edward A SSG RES USAR <
            > austin.cheney@...> wrote:
            >
            > > Where does the "use strict" declaration go? Does it go at the top of a
            > > JavaScript file, or at the top of a function, or both, or somewhere else?
            > >
            >
            > It must be the very first statement in a file. I'm sure that jslint will
            > tell you this. :)
            >
            > -Dom
            >
            > [Non-text portions of this message have been removed]
            >
            >



            [Non-text portions of this message have been removed]
          • Mark Volkmann
            ... I ve been working on a presentation to explain this and other changes in ECMAScript 5. You can see my summary at
            Message 5 of 6 , Sep 20, 2010
            • 0 Attachment
              On Thu, Sep 16, 2010 at 11:44 PM, Sean Kelly <home@...> wrote:

              >
              >
              > I'm new to this list so this may have been answered before but aside from
              > reading the source code to JSLint (thanks BTW), how do we go about
              > understanding exactly what strict mode does? The questions on stackoverflow
              > are kind of mixed and I didn't remember seeing any discussion of this on
              > jslint.com
              >

              I've been working on a presentation to explain this and other changes in
              ECMAScript 5. You can see my summary at
              http://java.ociweb.com/mark/programming/JavaScript/ECMAScript5.pdf

              Feedback on these slides is welcomed!

              --
              R. Mark Volkmann
              Object Computing, Inc.


              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.