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

Re: [jslint] Unexpected '.'

Expand Messages
  • 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 1 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 2 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 3 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.