Comment nested module class with JSDoc3

2019-06-04 21:29发布

I'm dealing with a module pattern in WebStorm's live inspection that I'm trying to comment.
And I don't want to use AMD/CJS.

;
My = (window.My || {});
My.Module = (My.Module || {});
My.Module.MyClass = (/**
 *
 * @param {My.Module.MyAnotherClass} MyAnotherClass
 */
    function (MyAnotherClass) {
    'use strict';

    /**
     * @class
     */
    var MyClass = function() {
        // constructor
    };

    /**
     * My sexy method.
     * @param {string} s
     */
    MyClass.prototype.myMethod= function(s) {
        var test = new MyAnotherClass(s);
    };

    return MyClass;
})(My.Module.MyAnotherClass);

Pretend that "MyAnotherClass" has the same type of comment. My issue is when I'm trying this : var test = new MyAnotherClass(s);, WebStorm is telling me that Method expression is not of Function type.

What can I do ?

Tell me if you need more information and sorry for my bad english.

L.

EDIT: It seems that removing the very first comment block with param definition is resolving the issue ... but I don't feel like it's the best way to go.

EDIT2: Same issue with property from an abstract class

0条回答
登录 后发表回答