readyou / jsdoc-toolkit

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

Defining objects within a function gives a warning #278

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I have a piece of code, similar to the following:
var foo = [];

function a() {
    foo[1] = {
        b : function() {}
    };

    foo[2] = {
        b : function() {}
    };
}

What is the expected output? What do you see instead?
jsdoc-toolkit should handle the code properly, but I get the following warning:
>> WARNING: Overwriting symbol documentation for: a.b.

What version of the product are you using? On what operating system?
jsdoc_toolkit-2.3.3-beta
Mac OS X 10.6.2

Please provide any additional information below.

Original issue reported on code.google.com by dusan.smolnikar@gmail.com on 20 Jan 2010 at 8:58

GoogleCodeExporter commented 9 years ago
Seems to be choking on indices and inefficient sub-scripting. Looks like we 
might need a @elementOf tag to handle this kind of issue. on a side note might 
want to consider rewriting what your doing to avoid that kind of construct as 
it is in itself inefficient.

Original comment by abyss...@gmail.com on 3 Jul 2010 at 3:59

GoogleCodeExporter commented 9 years ago
I agree that this warning could be avoided by rewriting the source code, but 
even if it is inefficient the sample code is valid an so it is a bug that JSDoc 
breaks on it.

It is not reasonable to get JSDoc 2 to support documenting subscripted names, 
as are used in the example, but I can at least get the tool to carry on without 
warning.

Please try out my proposed fix, committed in revision 844.

Original comment by micmath on 3 Jul 2010 at 7:05