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

1718Re: [jslint] Circular Function Definitions

Expand Messages
  • Felix E. Klee
    Jan 4, 2011
      On Tue, Jan 4, 2011 at 7:53 AM, Erik Eckhardt <erik@...> wrote:
      > I thought you were using a Boolean to indicate whether to make the
      > return call to f.

      No, that was correct. In the example code, I *was* using a boolean. Only
      in the real code, things are more complex:

      Based on what the XHR returns some calculations are performed, and - if
      needed - another XHR is made.

      > The point I was trying to get across is that you don't need the
      > circularity.

      What's bad about the circularity?

      > xhr(params, function() {callback(); f();}); // circular call back to f

      That would again be an infinite loop. The body of the anonymous function
      would need to be at least slightly more complex. I don't think this is
      increases readability.
    • Show all 17 messages in this topic