mryozo16 / jsdoc-toolkit

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

enclosed function are documented as _global_ function #308

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. have a script like this:
/**
 * @class
 */
MyClass = function(optin) {
  var testFunc;
  testFunc = function() {
    alert("123");
  }
 testFunc.apply(this,[]);
}
2. generate jsdoc with -a option

What is the expected output? What do you see instead?
_global_ namespace should be empty.

But when I do this _global_ contains testFunc in Method Summary

What version of the product are you using? On what operating system?
2.4.0

Please provide any additional information below.

Original issue reported on code.google.com by julbm...@gmail.com on 10 Dec 2010 at 2:54

GoogleCodeExporter commented 8 years ago
This is a known limitation of the weak lexical analyser used by JSDoc. I 
recommend against using the -a option if it is a problem, or, if you must have 
-a, you could write that code in a form that is more obvious, like so:

/**
 * @class
 */
MyClass = function(optin) {
  var testFunc1 = function() {
    alert("123");
  }

  function testFunc2() { alert("324"); }

  testFunc.apply(this,[]);
}

Original comment by micmath on 12 Dec 2010 at 9:17