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

2804Re: [jslint] Re: Predefined Globals Enhancement

Expand Messages
  • Joshua Bell
    Feb 24, 2012
      On Thu, Feb 23, 2012 at 9:50 AM, douglascrockford <douglas@...>wrote:

      > **
      > --- In jslint_com@yahoogroups.com, "benxwhite" <ben.a.white@...> wrote:
      > > It would be nice if the following predefined globals could be added to
      > the 'browser' array
      > >
      > > self
      > self is redundant.

      |self| is used to refer to the global scope when writing code that will run
      in Workers. When writing code that may execute in either Window or Worker
      context, it's nice to use |self| consistently.

      Alternately, you can use this pattern to wrap your script.

      (function (global) {
      // your code here...

      But the same argument applies to |window| in that case.

      [Non-text portions of this message have been removed]
    • Show all 4 messages in this topic