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

Re: Using "this" in constructor in strict mode

Expand Messages
  • Douglas Crockford
    ... Thanks. Please try it now.
    Message 1 of 2 , Aug 5, 2011
      --- 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.
    Your message has been successfully submitted and would be delivered to recipients shortly.