Thread: [Jsdoc-user] no jsdoc from valid javscript
Status: Inactive
Brought to you by:
mmathews
From: Henrik G. <he...@ma...> - 2006-07-27 20:52:34
|
If I have valid JavaScript like this: var DED = function() { var private_var; function private_method() {} return { public_var: 1, public_method : function() {} }; }(); I dont get any jsdocs out: Loading sources from test.js Nothing to document, exiting What can I do? Using JSDoc-1.9.9.2 |
From: <he...@ma...> - 2006-07-28 19:40:51
|
|If I have valid JavaScript like this: var DED = function() { /var private_var;/ /function private_method()/ { // do stuff here } return { method_1 : function() { // do stuff here } }; }(); I dont get any jsdocs out: Loading sources from test.js Nothing to document, exiting What can I do? | |
From: Larry R. <lj...@ho...> - 2006-07-28 21:12:51
|
I have had a similar issue. Im not sure if it's a bug in JSDoc or what, but try this: var DED; /** * comments.... */ DED = function () { Blah.... } For me I found I had to remove the var declaration from the line. Hope it works for you too. -----Original Message----- From: jsd...@li... [mailto:jsd...@li...] On Behalf Of Henrik Gemal Sent: Wednesday, July 26, 2006 11:30 PM To: jsd...@li... Subject: [Jsdoc-user] no jsdoc from valid javscript If I have valid JavaScript like this: var DED = function() { var private_var; function private_method() {} return { public_var: 1, public_method : function() {} }; }(); I dont get any jsdocs out: Loading sources from test.js Nothing to document, exiting What can I do? Using JSDoc-1.9.9.2 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Jsdoc-user mailing list Jsd...@li... https://lists.sourceforge.net/lists/listinfo/jsdoc-user |
From: Gabriel R. <gab...@gm...> - 2006-07-30 17:04:04
|
On Thu, Jul 27, 2006 at 08:29:58AM +0200, Henrik Gemal wrote: > If I have valid JavaScript like this: > > var DED = function() { > var private_var; > function private_method() {} > return { > public_var: 1, > public_method : function() {} > }; > }(); > > I dont get any jsdocs out: > Loading sources from test.js > Nothing to document, exiting > What can I do? > If you change the first line of this to: var DED = new function(){ then you should get results much closer to what you're expecting, without changing the functionality of your JavaScript code. The "new" keyword here is unfortunately an extra hint that the current incarnation of JSDoc needs in order to document this code. Regards, Gabriel |
From: Henrik G. <sp...@ma...> - 2006-07-30 19:10:31
|
Gabriel Reid wrote: > On Thu, Jul 27, 2006 at 08:29:58AM +0200, Henrik Gemal wrote: > >> If I have valid JavaScript like this: >> >> var DED = function() { >> var private_var; >> function private_method() {} >> return { >> public_var: 1, >> public_method : function() {} >> }; >> }(); >> >> I dont get any jsdocs out: >> Loading sources from test.js >> Nothing to document, exiting >> What can I do? >> >> > > If you change the first line of this to: > > var DED = new function(){ > > then you should get results much closer to what you're expecting, > without changing the functionality of your JavaScript code. The "new" > keyword here is unfortunately an extra hint that the current incarnation > of JSDoc needs in order to document this code. > It's correct that if I use "new function", I no longer get no jsdocs. But if you try to generate JSDoc from: var bla = new function() { var priv = 1; return { tester : function() {}, } }(); The "tester" function isn't mentioned. Isn't this a bug? |
From: Gabriel R. <gab...@gm...> - 2006-07-31 18:14:16
|
On Sun, Jul 30, 2006 at 09:10:28PM +0200, Henrik Gemal wrote: > Gabriel Reid wrote: > >On Thu, Jul 27, 2006 at 08:29:58AM +0200, Henrik Gemal wrote: > > > >>If I have valid JavaScript like this: > >> > >>var DED = function() { > >> var private_var; > >> function private_method() {} > >> return { > >> public_var: 1, > >> public_method : function() {} > >> }; > >>}(); > >> > >>I dont get any jsdocs out: > >>Loading sources from test.js > >>Nothing to document, exiting > >>What can I do? > >> > >> > > > >If you change the first line of this to: > > > > var DED = new function(){ > > > >then you should get results much closer to what you're expecting, > >without changing the functionality of your JavaScript code. The "new" > >keyword here is unfortunately an extra hint that the current incarnation > >of JSDoc needs in order to document this code. > > > It's correct that if I use "new function", I no longer get no jsdocs. > But if you try to generate JSDoc from: > > var bla = new function() { > var priv = 1; > return { > tester : function() {}, > } > }(); > > The "tester" function isn't mentioned. Isn't this a bug? Yes, this could indeed be considered a bug. Unfortunately, it's not a bug that is likely to be fixed in the near future (at least not in the current incarnation of JSDoc). The current version lacks a real JavaScript parser, making it very difficult to handle constructs such as this one. Regards, Gabriel |