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

Re: [jslint] Unexpected '.'

Expand Messages
  • John Hawkinson
    JSLint wants you wrap your function expression in parentheses. I think it s probably right, multiword expressions are confusing to read, and parens remove the
    Message 1 of 7 , Feb 14 11:12 AM
    • 0 Attachment
      JSLint wants you wrap your function expression in parentheses.
      I think it's probably right, multiword expressions are confusing to
      read, and parens remove the confusion.

      --jhawk@...
      John Hawkinson

      > var obj = {},
      > ````test = function () {
      > ````````'use strict';
      > ````````return true;
      > ````}.bind(obj);
      ...
      > Problem at line 5 character 6: Unexpected '.'.
    • douglascrockford
      ... Thanks. Please try it now.
      Message 2 of 7 , Feb 14 11:27 AM
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "spence.randall@..." <randall@...> wrote:
        >
        >
        > Given the following code:
        >
        > var obj = {},
        > ````test = function () {
        > ````````'use strict';
        > ````````return true;
        > ````}.bind(obj);
        >
        > JSLint returns the following error:
        >
        > Error:
        >
        > Problem at line 5 character 6: Unexpected '.'.
        >
        > }.bind(obj);
        >
        > Problem at line 5 character 6: Stopping. (62% scanned).

        Thanks. Please try it now.
      • spence.randall@ymail.com
        Works as expected, thanks for the fast turnaround. -Randall
        Message 3 of 7 , Feb 14 12:11 PM
        • 0 Attachment
          Works as expected, thanks for the fast turnaround.

          -Randall

          --- In jslint_com@yahoogroups.com, "douglascrockford" <douglas@...> wrote:
          >
          > --- In jslint_com@yahoogroups.com, "spence.randall@" <randall@> wrote:
          > >
          > >
          > > Given the following code:
          > >
          > > var obj = {},
          > > ````test = function () {
          > > ````````'use strict';
          > > ````````return true;
          > > ````}.bind(obj);
          > >
          > > JSLint returns the following error:
          > >
          > > Error:
          > >
          > > Problem at line 5 character 6: Unexpected '.'.
          > >
          > > }.bind(obj);
          > >
          > > Problem at line 5 character 6: Stopping. (62% scanned).
          >
          > Thanks. Please try it now.
          >
        • Jordan Harband
          The error does still occur if you do choose to wrap your function in parens. ... [Non-text portions of this message have been removed]
          Message 4 of 7 , Feb 17 6:48 PM
          • 0 Attachment
            The error does still occur if you do choose to wrap your function in parens.

            On Feb 14, 2012, at 11:27 AM, douglascrockford wrote:

            > --- In jslint_com@yahoogroups.com, "spence.randall@..." <randall@...> wrote:
            > >
            > >
            > > Given the following code:
            > >
            > > var obj = {},
            > > ````test = function () {
            > > ````````'use strict';
            > > ````````return true;
            > > ````}.bind(obj);
            > >
            > > JSLint returns the following error:
            > >
            > > Error:
            > >
            > > Problem at line 5 character 6: Unexpected '.'.
            > >
            > > }.bind(obj);
            > >
            > > Problem at line 5 character 6: Stopping. (62% scanned).
            >
            > Thanks. Please try it now.
            >
            >



            [Non-text portions of this message have been removed]
          • douglascrockford
            ... That is because you shouldn t do that.
            Message 5 of 7 , Feb 18 5:46 AM
            • 0 Attachment
              --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
              >
              > The error does still occur if you do choose to wrap your function in parens.


              That is because you shouldn't do that.
            • Jordan Harband
              Why do you recommend wrapping an immediate function invocation in parens, but not an immediate invocation of a function call on a prototype method of an
              Message 6 of 7 , Feb 19 1:02 PM
              • 0 Attachment
                Why do you recommend wrapping an immediate function invocation in parens, but not an immediate invocation of a function call on a prototype method of an anonymous function?

                On Feb 18, 2012, at 5:46 AM, douglascrockford wrote:

                > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
                > >
                > > The error does still occur if you do choose to wrap your function in parens.
                >
                > That is because you shouldn't do that.
                >
                >



                [Non-text portions of this message have been removed]
              Your message has been successfully submitted and would be delivered to recipients shortly.