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

Re: Mysterious and confusing error message on encountering destructuring assignment

Expand Messages
  • douglascrockford
    ... Thanks. JSLint now reports Bad assignment.
    Message 1 of 3 , Sep 10, 2009
    View Source
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "silver_7402" <silver_7402@...> wrote:
      >
      > If a script is entered into JSLint.com[1] containing a destructuring assignment[2], JSLint gives a strange error message[3] that has little or nothing to do with the actual cause of the error, then dies -- i.e. doesn't produce any more results. The message appears to indicate a problem in the script at that position, but is I think actually an error message from JSLint itself.
      >
      > I guess I'd like to see one of two things: either JSLint supporting this assignment syntax (nice, but will take a while, probably); or JSLint at any rate not crashing on it.
      > [p2, p1] = [p1, p2 + p1];


      Thanks. JSLint now reports "Bad assignment."
    • silver_7402
      ... Ah, much better. Now I can actually check the rest of the script.... Many thanks.
      Message 2 of 3 , Sep 11, 2009
      View Source
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "douglascrockford" <douglas@...> wrote:
        > Thanks. JSLint now reports "Bad assignment."
        >
        Ah, much better. Now I can actually check the rest of the script.... Many thanks.
      Your message has been successfully submitted and would be delivered to recipients shortly.