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

2485Re: [jslint] Re: Unused variable report giving wrong context

Expand Messages
  • Erik Eckhardt
    Jul 15, 2011
    • 0 Attachment
      Apparently I misunderstood the purpose of the context variable. Thank you
      for setting me straight and sorry to waste your time.

      On Fri, Jul 15, 2011 at 4:37 PM, Douglas Crockford <douglas@...>wrote:

      > **
      >
      >
      > --- In jslint_com@yahoogroups.com, Erik Eckhardt <erik@...> wrote:
      > >
      > > I'm using a library expects a callback function with certain parameters.
      > I
      > > only am interested in the second parameter, but must have an unused first
      > > parameter.
      > >
      > > with this code snippet:
      > >
      > > $.each(properties, function (index, value) { ...
      > >
      > > The "unused variable" report at the bottom of jslint incorrectly
      > displayed
      > >
      > > *index* *166 * 'properties'
      > >
      > > which is not correct as the context is `each`.
      >
      > The context of index is an anonymous function that comes after
      > 'properties'. The report is right.
      >
      >
      >


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