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

30Labels and scope

Expand Messages
  • Douglas Crockford
    Apr 18, 2008
      I corrected an error in JSLint that created a scope around labeled
      statements.

      function a() {
      foo:
      for (var i = 0; false;) {
      }
      return i;
      }

      As a result, it used to find an error on the return statement because
      i was out of scope.