wenchun / jsdoc-toolkit

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

TypeError: Cannot read property "isUserComment" from undefined #135

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. running java -jar jsrun.jar app/run.js -p -a -r=100
-d=/home/rothfuss/www/jsdoc -t=templates/outline
/home/rothfuss/jsdoc/javascript/ 2> /home/rothfuss/www/jsdoc/errors.txt

What is the expected output? What do you see instead?

no crash. crashes with TypeError: Cannot read property "isUserComment" from
undefined

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

2.0.beta2.3 on linux

Please provide any additional information below.

Original issue reported on code.google.com by rothf...@gmail.com on 6 May 2008 at 8:36

GoogleCodeExporter commented 8 years ago
Does this same error occur when using the jsdoc template?

Original comment by micmath on 6 May 2008 at 9:06

GoogleCodeExporter commented 8 years ago
yes, same thing. i also tried with a svn checkout of the 2.0 branch. i get a 
slightly
different error there:

js: uncaught JavaScript runtime exception: TypeError: Can't use instanceof on a
non-object.

Original comment by rothf...@gmail.com on 6 May 2008 at 9:41

GoogleCodeExporter commented 8 years ago
I suspect this must be related to the input files you are using, otherwise it 
would
have appeared already in testing. Therefore it would help me to know what input 
was
associated the exception. Can you possibly determine which js source file is 
related
and send that to me, or can you send me a zip of all the source files you are 
trying
to use as input and send that?

Finally, if you run with jsdebug.jar instead of js.jar, and then select menu 
item:
 Debug > Break on Exceptions
and then hit the "Go" button, you should be able to report the exact file and 
line
that throws the exception.

Original comment by micmath on 7 May 2008 at 6:31

GoogleCodeExporter commented 8 years ago
sorry, no can do at this time. it is the js source for maps.google.com.

i'll give the jsdebug a shot and try to reduce a test case for you.

thanks for your help!

Original comment by rothf...@gmail.com on 7 May 2008 at 8:05

GoogleCodeExporter commented 8 years ago
Parser.js:21 throws the error.

copy & paste from the debugger does not seem to work. which values of this or 
Locals
would be helpful?

if i am reading the debugger correctly, then the offending js is:

/**
 * @param {Object} object
 * @return {string}
 */
function toSource(object) {}

screenshot attached.

Original comment by rothf...@gmail.com on 8 May 2008 at 3:42

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for reporting this.

Fixed bug that prevented symbols having same name as built in properties, like
toString. (issue #135)

app/lib/JSDOC/Parser.js
app/lib/JSDOC/SymbolSet.js

Committed revision 589.

Original comment by micmath on 8 May 2008 at 11:45

GoogleCodeExporter commented 8 years ago
thanks, synced to head and reran. now i get

js: uncaught JavaScript runtime exception: TypeError: Can't use instanceof on a
non-object.

on JsDoc.js:124

Original comment by rothf...@gmail.com on 9 May 2008 at 4:56

GoogleCodeExporter commented 8 years ago
Might be easier if you give me the source code you are documenting. Is that 
possible?

Original comment by micmath on 9 May 2008 at 7:37

GoogleCodeExporter commented 8 years ago
I believe this is fixed in revision 592. Can you verify please?

On a hunch, looking at the line number you provided, I could reproduce the 
exception
by feeding JsDoc Toolkit a non .js file, which must be what you're doing, 
probably
via a folder of many files, not all of which are .js. The correct behavior is 
for
JsDoc Toolkit to ignore those non .js files unless you've defined your own 
handler,
but the handler list was not defined (I'd inadvertently commented it out).
Uncommented the handler list definition and the exception goes away.

Thanks again for you bug reports. You've helped uncover some real nasties today.

Original comment by micmath on 9 May 2008 at 7:52

GoogleCodeExporter commented 8 years ago
indeed, it now works. i still have lots and lots of warnings, but no crashes.

i am impressed. if you can deal with this javascript, you can deal with 
anything :)

Original comment by rothf...@gmail.com on 9 May 2008 at 6:11

GoogleCodeExporter commented 8 years ago

Original comment by micmath on 9 May 2008 at 8:53

GoogleCodeExporter commented 8 years ago
Thank You. 

If I deleted all the non .js files from the source directory the documentation 
was
generated. Looks like -x flag is not detected. Thanks again the comments above 
saved
time. Kumar

-x=<EXT>[,EXT]... or --ext=<EXT>[,EXT]...
          Scan source files with the given extension/s (defaults to js).

Original comment by kumarave...@gmail.com on 1 Jul 2009 at 10:29

GoogleCodeExporter commented 8 years ago
Can I mark this a fixed then?

Original comment by micmath on 3 Jul 2009 at 12:11