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

3013Re: [jslint] `this` in anonymous function without strict violation?

Expand Messages
  • Tom Worster
    Sep 19, 2012
    • 0 Attachment
      On 9/19/12 4:47 PM, "Felix E. Klee" <felix.klee@...> wrote:

      >On Fri, Sep 7, 2012 at 1:21 PM, Tom Worster <fsb@...> wrote:
      >> this is just JSLint saving you time in detecting an ES5 strict mode
      >> error
      >>
      >> see http://is.gd/WCXyRm
      >
      ><url:https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Funct
      >ions_and_function_scope/Strict_mode?redirectlocale=en-US&redirectslug=Ja
      >vaScript%2FStrict_mode#.22Securing.22_JavaScript>
      >
      >Thanks for the link. I now read the article, and I understand that
      >JSLint is just warning about a strict mode error. However, I do not
      >understand why "function f()" is treated differently than "var f =
      >function ()". Aren't the two statements equivalent? Or am I missing
      >something?


      (i'm an incompetent but) i see it as analogous to the difference between:

      f =

      and

      var f =

      i the latter, function f is clearly within the scope of the strict mode
      function it appears in. no danger using this in there.

      and if that's wrong then i'll just declare that it's a good enough
      metaphor for me:)
    • Show all 14 messages in this topic