#121 Functions in JavaScript prototype don't get blockquote box


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/


  • Greg Valure

    Greg Valure - 2011-04-20

    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.

  • Lawrence Davis

    Lawrence Davis - 2011-04-22

    Thanks Greg, the workaround you provided does the trick and is actually a preferable of writing the comments.


Log in to post a comment.