omni360 / jsdoc-toolkit

Automatically exported from code.google.com/p/jsdoc-toolkit
0 stars 0 forks source link

Unnecessary warnings of the type [java] >> WARNING: Trying to document 'xyz' without first documenting 'abc'. are generated for methods of types when the type is declared and initialized as a constructor in the same step. #328

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
For example,
var Cat = function() {
    // function body
};
Cat.prototype.meow = function () {
    // method body
};
will yield the warning [java] >> WARNING: Trying to document Cat#meow without 
first documenting Cat. 

Meanwhile, 
var Cat;
Cat = function() {
    // function body
};
Cat.prototype.meow = function () {
    // method body
};
produces no warnings.

What version of the product are you using? On what operating system?
jsdoc-toolkit-2.4.0 on Windows 7.

Original issue reported on code.google.com by Kristian...@gmail.com on 17 Aug 2011 at 5:55

GoogleCodeExporter commented 8 years ago
I get no warning from the following code, using the latest (Revision: 742) from 
the repo:

/** @constructor */
var Cat = function() {
   // function body
};

Cat.prototype.meow = function () {
   // method body
};

Using the following command line:
java -jar jsrun.jar app/run.js -t=templates/jsdoc/ cat.js -a

Can you please provide more information that would allow me to reproduce your 
issue?

Original comment by micmath on 17 Aug 2011 at 9:15

GoogleCodeExporter commented 8 years ago
I should have mentioned that the code was wrapped in an anonymous function as 
part of a file in a larger project and was not meant to be documented. I even 
tried using @ignore and @private tags to get rid of the warnings, but they did 
not help. Therefore, continuing with the Cat example, there were no comments or 
@constructor tag. I also was not using the -a command line option (I just tried 
and still received the warning); the only command line options in use were -t, 
-D="noGlobal:true", -x, and -d for the specifics of my project.

Original comment by Kristian...@gmail.com on 18 Aug 2011 at 3:26

GoogleCodeExporter commented 8 years ago
Sorry but I still get no warning and there is no cat is in my docs either. My 
source code is this:

// cat.js
(function() { // wrapped in an anonymous function

    // no comments or @constructor tag here
    var Cat = function() {
        // function body
    };

    Cat.prototype.meow = function () {
        // method body
    };

})();

And the command line I am using is this:
$ java -jar jsrun.jar app/run.js -t=templates/jsdoc/ -D="noGlobal:true" -x=.js 
-d=out cat.js

Please try the above for yourself, using exactly that source code and that 
command line, with the latest version from the SVN repo. If I have 
misunderstood you somehow, please provide the correct source code and command 
line I should be using to reproduce your issue.

Original comment by micmath on 18 Aug 2011 at 8:31

GoogleCodeExporter commented 8 years ago
Retried with corrected -x value, but no difference.

$ java -jar jsrun.jar app/run.js -t=templates/jsdoc/ -D="noGlobal:true" -x=js 
-d=out cat.js

Original comment by micmath on 18 Aug 2011 at 8:43