Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2D array @params #705

Closed
chrisveness opened this issue Jul 9, 2014 · 2 comments
Closed

2D array @params #705

chrisveness opened this issue Jul 9, 2014 · 2 comments
Labels
Milestone

Comments

@chrisveness
Copy link

Please advise if I've misunderstood something, but I was expecting to be able to document a 2-d array parameter as follows:

/**
 * @param {number[][]} matrix - The matrix to be transformed.
 */
function tx(matrix) {}

However, this generates ERROR: Unable to create a Tag object for source file ... with title "param" and body "{number[][]} matrix - The matrix to be transformed.": Invalid type expression "number[][]": Expected "!", "?" or "|" but "[" found.

Is there an alternative way of indicating a 2-d array, or is this a feature request? Thx.

@hegemonic hegemonic added this to the 3.3.0 milestone Jul 14, 2014
@hegemonic
Copy link
Contributor

Yes, I believe JSDoc Toolkit 2.x supported this syntax. I agree that JSDoc 3 ought to support it as well.

The alternative is to use Closure Compiler-style notation, like this: Array.<Array.<number>> (the periods are optional).

@hegemonic
Copy link
Contributor

Fixed on master. I'm publishing a new alpha to npm shortly, which will also include this fix.

Note that if you installed JSDoc by cloning the git repo or something like that, you'll need to run npm update catharsis in your JSDoc directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants