douglascrockford/JSLint — Issue #85: newcap has no effect
Author: shannonmoeller
Created: 2011-10-30 21:43:06+00:00
State: open

The following code generates the newcap error when newcap is specified to both true and false.

(function () {
'use strict';

var Foo, Bar;

Foo = function () {};
Foo.maker = function () {
var foo = new this();

// manipulate foo

return foo;
};

Bar = function () {};
Bar.prototype = new Foo();
Bar.maker = Foo.maker;

}());

Expected one of the settings to suppress the message:

Error:
Problem at line 9 character 23: A constructor name 'this' should start with an uppercase letter.

var foo = new this();