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

1417Re: Calling With Too Much Parameters

Expand Messages
  • pauanyu
    Aug 10, 2010
    • 0 Attachment
      Don't forget that it's possible to access the non-named parameters using the "arguments" object.

      I suppose if the function does not access the arguments object, then throwing a warning or error in that case might be nice.

      In any case, if the function is called with more arguments than it expects, it simply ignores the excess. I'm not sure why that would cause a bug in the plugin.

      --- In jslint_com@yahoogroups.com, Jean-Charles Meyrignac <jcmeyrignac@...> wrote:
      > I just discovered a bug in a Firefox plugin, and the bug was that a routine
      > using 3 parameters was called with 4 parameters.
      > So I did a little test with jslint:
      > function test(a,b,c)
      > {
      > return a+b+c;
      > }
      > test(1,2,3,4);
      > Shouldn't JsLint send a warning on this ?
      > JC
      > [Non-text portions of this message have been removed]
    • Show all 8 messages in this topic