/** * @constructor */ function SomeConstructor() { } SomeConstructor.prototype = { /** * This one triggers the error. */ someMethod: function() { this.foo = bar; }, }; (function() { /** * @constructor */ function SomeOtherConstructor() { } SomeOtherConstructor.prototype = { /** * This one doesn't trigger the error. */ someMethod: function() { this.foo = bar; }, }; })(); foo(function() { /** * @constructor */ function TheThirdConstructor() { } TheThirdConstructor.prototype = { /** * This one doesn't trigger the error. */ someMethod: function() { this.foo = bar; }, }; });