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

299return [expression] -> "unable to continue"

Expand Messages
  • crlender
    Oct 30, 2008
    • 0 Attachment
      The following example causes the JSLint parser to fail:

      var cache;
      function foo () {
      // ...
      return cache = calculate();
      }

      Using extra parentheses works:

      return (cache = calculate());

      Since parens are not required here (ECMA-262, ed3, 12.9), and JSLint
      normally complains about extra parens, I wanted to ask if that's on
      purpose or a bug?


      - Conrad


      JSLint output:
      --------------------------------------------------

      Lint at line 4 character 17: Missing semicolon.
      return cache = calculate();

      Lint at line 4 character 18: Expected an identifier and instead saw '='.
      return cache = calculate();

      Lint at line 4 character 18: Stopping, unable to continue. (37% scanned).
    • Show all 3 messages in this topic