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

2561Re: Using "this" in constructor in strict mode

Expand Messages
  • Douglas Crockford
    Aug 5, 2011
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "s_lubowsky" <slubowsky@...> wrote:
      > I just grabbed the latest jslint (8/3/11) and suddenly its complaining that using "this" is a constructor is a strict violation. I searched around a bit but didn't see anybody talk about this. Is this a true violation? If so, what is the "correct" way to right it.
      >
      > For example linting the following code on www.jslint.com fails with Problem at line 3 character 5: Strict violation.
      > this.foo = "foo";
      >
      > function TestThisInConstructor() {
      > "use strict";
      > this.foo = "foo";
      > }

      Thanks. Please try it now.
    • Show all 2 messages in this topic