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

Re: Early Unused Arguments

Expand Messages
  • benquarmby
    Thanks for the reply. Of course you re right (an annoying habit). Do you have a suggestion on creating callback / handler functions like this that don t look
    Message 1 of 11 , Apr 30, 2012
    • 0 Attachment
      Thanks for the reply. Of course you're right (an annoying habit).

      Do you have a suggestion on creating callback / handler functions like this that don't look like errors? (Other than "don't use stupid APIs" that is :)

      What do you think of this?
      http://tech.groups.yahoo.com/group/jslint_com/message/2863

      --- In jslint_com@yahoogroups.com, "douglascrockford" <douglas@...> wrote:
      >
      > --- In jslint_com@yahoogroups.com, "benquarmby" <ben.quarmby@> wrote:
      >
      > > This argument aside (ba-dum-tish!), my real question is whether JSLint should allow early unused arguments. So translating my earlier sample:
      > >
      > > anythingFromAnyApi.onSomeEvent = function (a, b) {
      > > iAmUsing(b);
      > > };
      > >
      > > Should JSLint warn that "a" is unused when I can't control the number of arguments in this case?
      >
      >
      > Yes it should, because it is often an error. But if you are intentionally writing code that looks like an error, and don't want to be reminded of that fact, then use the Tolerate unused parameters option.
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.