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

/*jslint */ and function scope

Expand Messages
  • Douglas Crockford
    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
    Message 1 of 2 , Mar 5 7:24 AM
    • 0 Attachment
      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;
      ` }
    • Woomla
      Great! Many thanks. No need to do something alike myself anymore :-)
      Message 2 of 2 , Mar 7 1:11 AM
      • 0 Attachment
        Great! Many thanks. No need to do something alike myself anymore :-)

        --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
        >
        > 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;
        > ` }
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.