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

80Re: scope bug? catch (e) "e already defined"

Expand Messages
  • Douglas Crockford
    Jun 16, 2008
      --- In jslint_com@yahoogroups.com, "wleingang" <wleingang@...> wrote:
      >
      > Hi. Has anyone run into this before?
      >
      > try {
      > this.var1 = "test";
      > }catch (e) {}
      >
      > try {
      > this.var2 = "test";
      > }catch (e) {}
      >
      >
      > On the second catch, JSLint thinks that e is already defined... even
      > though from that scope there is no way it is already defined. Unless I
      > don't understand this should be valid code right?

      There are scope definition problems with respect to catch in some
      browsers. I recommend that you give each catch its own name (e1, e2)
      to be safe.
    • Show all 7 messages in this topic