dericktang / jsdoc-toolkit

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

Separate symbol with same function names crashes app if defined with an alias #245

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Steps to reproduce the problem?
1. Download attached files
2. Fix paths and run "java -jar jsdoc\jsrun.jar jsdoc\app\run.js 
LineOverlay.js IrregularPolyOverlay.js RectangleOverlay.js -d=docs -
t=jsdoc\templates\jsdoc -a=true -p=true"
3. Comment out the memberOf function and the classes document but into the 
global namespace

Expected Output: No error
Received Output: 
js: uncaught JavaScript runtime exception: TypeError: Cannot set 
property "alias" of undefined to "ClassNameHere"

Product Versions:
JSDoc - 2.3.0 
OS - WindowsXP 
Java - 1.5.0_11-b3

Attached are three files that when attempted to run with will produce this 
error. 

Original issue reported on code.google.com by justin.c...@gmail.com on 28 Aug 2009 at 2:01

Attachments:

GoogleCodeExporter commented 8 years ago
The error message is a little mysterious I admit, but the problem in your 
example is that you are using the 
@name tag to declare documentation for three global functions, all named 
"getEditDisplayNode".

The docs for @name explain that you must give the "namepath" when using the 
@name tag, and the 
namepath must be "a unique identifier that maps to that variable". But the 
namepath "getEditDisplayNode" 
isn't unique when you use it three times. You appear to be trying to use the 
@memberOf tag to distinguish 
one getEditDisplayNode from another, but that won't work: the namepath is 
considered canonical and isn't 
affected by @memberOf.

Try this pattern this instead:

/** Returns an html node used for editing.
    * @name CHK.GIS.Web.CHKWebMap.ClientAPI.RectangleOverlay.prototype.getEditDisplayNode
    * @function  
    * @return {Node}
    */

Original comment by micmath on 1 Sep 2009 at 8:29