Functions in JavaScript prototype don't get blockquote box
Multi-language source code documentation tool
Brought to you by:
gregvalure
For JavaScript objects such as:
var SomeClass = function(arg1, arg2) {}
when declaring a function as part of the object's prototype:
SomeClass.prototype.someFunction = function(arg1, arg1) {}
SomeClass.someFunction does not get the blockquote/Prototype table treatment in the generated docs that functions declared as properties of the object do:
SomeClass.someOtherFunction = function(arg1, arg2) {}
See attached file for test case and screenshot.
Version: NaturalDocs 1.51
Flags used: ./NaturalDocs -p ~/docs/ -i ~/src/ -o HTML ~/docs/
Test case and screenshot for this bug -- run the JS through NaturalDocs to see the problem
Screenshot of Functions section of generated documentation
Test case -- run through NaturalDocs to see the problem
This is because it's trying to match the name in the comment "SomeClass.someFunction", with the name in the prototype, "SomeClass.prototype.someFunction", and failing. Since you documented the class you actually don't need the qualifier, they're already seen as part of its scope, so you can just write "Function: someFunction" and it will work.
I'm leaving this bug open until I deal with the underlying issue, but that should allow you to work around it.
Thanks Greg, the workaround you provided does the trick and is actually a preferable of writing the comments.