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

Use @param tags in function assignment #6552

Closed
billti opened this issue Jan 20, 2016 · 0 comments
Closed

Use @param tags in function assignment #6552

billti opened this issue Jan 20, 2016 · 0 comments
Assignees
Labels
Fixed A PR has been merged for this issue

Comments

@billti
Copy link
Member

billti commented Jan 20, 2016

Using the Salsa work with @param tags works fine for function declarations, but not for assignments of function expressions. This is particularly a problem in the CommonJS case. For example with the module below, sub correctly shows the params as of type number, whereas add shows them as type any.

/**
 * @param {number} a The number to subtract from
 * @param {number} b The number to subtract
 */
function sub(a, b) {
    return a - b;
}

exports.sub = sub;

/**
 * @param {number} a - First term
 * @param {number} b - Second term
 */
exports.add = function(a, b) {
    return a + b; 
}

The JsDoc tags should apply to the resulting value of the expression.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants