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

Bug: unintialized variable with name 'constructor' gives strange error

Expand Messages
  • bertbelder
    It seems that using a variable named constructor that is not declared (which in itself is wrong off course) always produces a strange error. The rhino
    Message 1 of 4 , Mar 4 12:48 PM
    • 0 Attachment
      It seems that using a variable named "constructor" that is not declared (which in itself is wrong off course) always produces a strange error. The rhino version of JSLint even crashes when you make this mistake. It actually caused me not to use JSLint on my source until I had the time to locate the source of the problem by eliminating each line in the source one-by-one.

      Trying to lint this:
      constructor = 1;

      JSLint produces the error:
      Problem at line 1 character 15: a.push is not a function
    • Douglas Crockford
      ... Thanks for the report. Please try it again.
      Message 2 of 4 , Mar 4 1:14 PM
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "bertbelder" <bertbelder@...> wrote:
        >
        > It seems that using a variable named "constructor" that is not declared (which in itself is wrong off course) always produces a strange error. The rhino version of JSLint even crashes when you make this mistake.

        > Trying to lint this:
        > constructor = 1;
        >
        > JSLint produces the error:
        > Problem at line 1 character 15: a.push is not a function

        Thanks for the report. Please try it again.
      • bertbelder
        Wow! I ve never had a response to a bug report that quickly, ever. It s fixed indeed. Thanks. -Bert
        Message 3 of 4 , Mar 4 1:26 PM
        • 0 Attachment
          Wow! I've never had a response to a bug report that quickly, ever.
          It's fixed indeed.

          Thanks. -Bert
        • santini.alberto
          ... Linted on itself: Error: Problem at line 180 character 1: Expected an assignment or function call and instead saw an expression. use strict ; Problem at
          Message 4 of 4 , Mar 5 12:16 PM
          • 0 Attachment
            --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...>
            > Thanks for the report. Please try it again.

            Linted on itself:

            Error:

            Problem at line 180 character 1: Expected an assignment or function call and instead saw an expression.

            "use strict";

            Problem at line 3567 character 17: Expected 'if' to have an indentation of 12 instead of 16.

            if (typeof s === 'function') {

            Problem at line 3568 character 21: Expected 's' to have an indentation of 16 instead of 20.

            s = false;

            Problem at line 3569 character 17: Expected '}' to have an indentation of 12 instead of 16.

            }


            Regards,
            Alberto
          Your message has been successfully submitted and would be delivered to recipients shortly.