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

Labels and scope

Expand Messages
  • Douglas Crockford
    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
    Message 1 of 1 , Apr 18 4:14 PM
    • 0 Attachment
      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.
    Your message has been successfully submitted and would be delivered to recipients shortly.