我正在尝试记录函数生成器但没有成功,这是一个示例:
function genericObjectGenerator(tagname) {
var specificObject = function () {};
specificObject.getClassName = function () {
return tagname;
}
specificObject.prototype.sayHello = function(name) {
return tagname + " says hello to " + name;
}
return specificObject;
}
var MyObject = genericObjectGenerator("object1");
var myObjectInstance = new MyObject();
myObjectInstance.sayHello();
我应该如何记录 genericObjectGenerator 及其 specificObject 函数,以便让 JSDoc(和 IntelliJ)正确解析 sayHello。