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

79Re: [jslint] scope bug? catch (e) "e already defined"

Expand Messages
  • wleingang
    Jun 16, 2008
      --- In jslint_com@yahoogroups.com, Thomas Koch <thomas@...> wrote:
      > I've another issue with already defined, which even appears in yui:
      >
      > if (typeof YAHOO == "undefined" || !YAHOO) {
      > /**
      > * The YAHOO global namespace object. If YAHOO is already
      defined, the
      > * existing YAHOO object will not be overwritten so that defined
      > * namespaces are preserved.
      > * @class YAHOO
      > * @static
      > */
      > var YAHOO = {};
      > }
      >
      > taken from yuiloader-beta.js, line 64.
      >
      > It would be nice, if I could use this pattern without having Jslint
      > complaining.

      I had the same problem. I ended up replacing those namespace
      declarations in each individual file with /*global YAHOO*/

      I agree that if you are checking for its existance before defining
      it, then it shouldn't complain... but I am not sure where a syntax
      checker leaves off and a compiler takes over.

      Will
    • Show all 7 messages in this topic