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

Unexpected '.'

Expand Messages
  • spence.randall@ymail.com
    Given the following code: var obj = {}, ````test = function () { ```````` use strict ; ````````return true; ````}.bind(obj); JSLint returns the following
    Message 1 of 7 , Feb 14, 2012
    • 0 Attachment
      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).
    • 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 2 of 7 , Feb 14, 2012
      • 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 3 of 7 , Feb 14, 2012
        • 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 4 of 7 , Feb 14, 2012
          • 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 5 of 7 , Feb 17, 2012
            • 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 6 of 7 , Feb 18, 2012
              • 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 7 of 7 , Feb 19, 2012
                • 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.