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

Re: "Stopping, unable to continue" errors on mulitple variable assigment

Expand Messages
  • Douglas Crockford
    ... JSLint will now accept var z = x.y = test ; It will continue to reject var z = x = test ; because a common error is to think that it means the same thing
    Message 1 of 3 , Apr 27, 2009
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "kevin_hakanson" <kevin.hakanson@...> wrote:
      >
      > I was code reviewing some code, which is similar to the structure below:
      >
      > var x = { "y" : "not test"};
      > var z = x.y = "test";

      JSLint will now accept

      var z = x.y = "test";

      It will continue to reject

      var z = x = "test";

      because a common error is to think that it means the same thing as

      var z = "test", x = "test";
    • Stepan Reznikov
      ... Maybe JSLint should reject it only when the x variable has not been declared before?
      Message 2 of 3 , Apr 28, 2009
      • 0 Attachment
        > It will continue to reject
        > var z = x = "test";

        Maybe JSLint should reject it only when the x variable has not been
        declared before?
      Your message has been successfully submitted and would be delivered to recipients shortly.