swallowzhang / jsdoc-toolkit

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

Module pattern (singleton) #222

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

I am new to jsdoc-toolkit, so I'm probably wrong and perhaps there is some
way to achieve what I'm trying to do. But I have found out that when I use
this common JavaScript pattern:

/**
 * Blah, blah, blah...
 */
var namespace = {};

/**
 * @namespace This module contains blah, blah, blah...
 */
namespace.submodule = (function() {

    /**
     * The object to be returned by this module.
     */
    var foo = {};

    return foo;
})();

All the content inside the self-invocation function seems to not be parsed
by jsdoc (there is no information about foo). If I remove the parentheses
around the function definition it does work.

Is this a jsdoc issue? If not, please, could you tell me how to do it?
Sorry for the inconvenience and thank you in advance.

Original issue reported on code.google.com by cface...@gmail.com on 21 Jun 2009 at 5:05

GoogleCodeExporter commented 8 years ago
Your timing is remarkable: this was previously reported in issue #213 and a fix 
was committed earlier today. I 
don't know the specific revision it was committed off hand, but it is 
definitely in revision 801 and later. If you 
can grab a copy of the current version from svn and test the fix I'd be very 
grateful, otherwise it will be in the 
next release: 2.3.0, which should be posted tomorrow.

Original comment by micmath on 21 Jun 2009 at 10:48

GoogleCodeExporter commented 8 years ago
I'm very sorry, I hadn't seen the other issue.

Anyway, I have just grabbed the current version from the repository and, yes, 
now it seems to be working 
perfectly (at least, the example I had submitted). I still hadn't have time to 
check it with my real script of about 
two thousand JavaScript lines, I will do tomorrow and I would let you know 
about the results in case you are 
interested.

Thank you very much for your answer.

Original comment by cesarfac...@gmail.com on 21 Jun 2009 at 11:27