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

Re: [jslint] Re: Circular Function Definitions

Expand Messages
  • Felix E. Klee
    On Sat, Jan 8, 2011 at 4:05 PM, Douglas Crockford ... Thanks for the suggestion! I guess I ll take this approach and put the lengthy do something into a
    Message 1 of 17 , Jan 8, 2011
    • 0 Attachment
      On Sat, Jan 8, 2011 at 4:05 PM, Douglas Crockford
      <douglas@...> wrote:
      > ` var sendToServer;
      > `
      > ` function f() {
      > ` sendToServer('xyz', function (moreToDo) {
      > ` // do something ...
      > ` if (moreToDo) {
      > ` f();
      > ` }
      > ` });
      > ` }

      Thanks for the suggestion! I guess I'll take this approach and put the
      lengthy "do something" into a separate function.

      Just thinking about it: I assume that having JSLint to *not* report an
      error on circular function definitions is non-trivial. That is, if one
      still wants to be warned about cases were an undefined function would be
      called, such as:

      function f() {
      g();
      }

      f();

      function g() {
      // do something
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.