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

2010/*jslint */ and function scope

Expand Messages
  • Douglas Crockford
    Mar 5, 2011
      The /*jslint */ directive now respects function scope. That means that if you change an option setting inside of a function body, it will revert on leaving the function body.

      In this example, there is no warning for and, but there is a warning for nuther.

      ` /*jslint bitwise: true */
      `
      ` function and(a, b) {
      ` /*jslint bitwise: false */
      ` return a & b;
      ` }
      `
      ` function nuther(a, b) {
      ` return a & b;
      ` }
    • Show all 2 messages in this topic