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

2260Re: [jslint] Re: option.type

Expand Messages
  • Martin Cooper
    Jun 5, 2011
      On Sun, Jun 5, 2011 at 6:18 PM, Douglas Crockford <douglas@...> wrote:
      > Has anyone tried the new type consistency checking?

      Inadvertently, yes. :) It highlighted some strange code of the form:

      if (false == filePath) {
      ...
      var cmd = 'cd ' + filePath;

      (I don't know why the test was written like that.)

      In this particular case, it would have been caught in code review, but
      JSLint did call attention to a function argument being tested as
      Boolean and then used as String.

      > Has anyone found it to be useful?

      Debatable in this case, because it was sufficiently obvious already,
      but potentially useful.

      --
      Martin Cooper


      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Show all 9 messages in this topic