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

Re: RE: [jslint] "use strict";

Expand Messages
  • 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 1 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 2 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 3 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 4 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.