jsdoc3/jsdoc — pull request #312 by mathematicalcoffee (2013-01-18 05:22:40+00:00)
Title: Fix for `[constructor]{@link ..}` with markdown enabled: jsdoc3/jsdoc#249

Fixes jsdoc3/jsdoc#249 whereby having the markdown plugin enabled and typing `[constructor]{@link something}` would cause an error.

The error was because in both plugins, `[some text]` is valid as a markdown link, as in:

Go to [google].
[google]: http://www.google.com

So the `[constructor]` bit was being parsed as a link by the markdown plugin.

Both parsers were doing something like

if (link_hash_table[link_id]) {
// ... use link_hash_table[link_id], expected to be a string
}

Really it should have been using

if (link_hash_table.hasOwnProperty(link_id)) {
// ... use link_hash_table[link_id], expected to be a string
}

Otherwise if there was no `[constructor]: url` in the markdown, `link_hash_table.constructor` would look up the *function* `Array.constructor`, which was what caused the error.

I fixed both parsers to use `.hasOwnProperty`.