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

Warning for duplicate function

Expand Messages
  • woomla
    This code jslint fine, but the second aa function is not accessible. Can t jslint give a warning for this? use strict ; var NN = ; function aa(name) { NN =
    Message 1 of 2 , Nov 2, 2009
    • 0 Attachment
      This code jslint fine, but the second aa function is not accessible.
      Can't jslint give a warning for this?


      "use strict";


      var NN = '';

      function aa(name)
      {
      NN = name;
      }

      function aa(boolean)
      {
      NN = boolean ? 'true' : 'false';
      }

      aa('yes');
    • Douglas Crockford
      That s a good question. The only warning JSLint gives is that aa is global. JSLint is more forgiving of global mishaps, assuming that if you are doing things
      Message 2 of 2 , Nov 2, 2009
      • 0 Attachment
        That's a good question. The only warning JSLint gives is that aa is global.
        JSLint is more forgiving of global mishaps, assuming that if you are doing
        things globally, then you aren't concerned with correctness. I will look at this
        again. Thanks.


        woomla wrote:
        > This code jslint fine, but the second aa function is not accessible.
        > Can't jslint give a warning for this?
        >
        >
        > "use strict";
        >
        >
        > var NN = '';
        >
        > function aa(name)
        > {
        > NN = name;
        > }
        >
        > function aa(boolean)
        > {
        > NN = boolean ? 'true' : 'false';
        > }
        >
        > aa('yes');
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.