Javascript JsDoc:删除;“静态”;来自属性的标记

Javascript JsDoc:删除;“静态”;来自属性的标记,javascript,jsdoc,Javascript,Jsdoc,我用JavaScript编写了图形构造函数。文档有点粗糙。以下是我的代码和文档中无法正常工作的部分: function Graph() { .... var nodes = []; Object.defineProperties(this, { /** * An array of all node handles in the graph * * @return {Array} */

我用JavaScript编写了图形构造函数。文档有点粗糙。以下是我的代码和文档中无法正常工作的部分:

function Graph() {
    ....
    var nodes = [];
    Object.defineProperties(this, {
        /**
         * An array of all node handles in the graph
         *
         * @return {Array}
         */
        nodes: {
            get: function() {
                var ids = [];
                for (var id in nodes) {
                    ids.push(id);
                }
                return ids;
            }
        }
    });
    ....
}
基本上,我要做的是确保图形不能用其他方法操作,而不是通过提供节点列表的副本(而不是实际的节点列表)提供的方法

这很好,但在JsDoc中,它被定义为静态:

<static>    Graph.nodes
            An array of all node handles in the graph
Graph.nodes
图中所有节点句柄的数组
现在,这个属性不是静态的。它对于图形的所有实例都是单独的。我的猜测是,JsDoc识别出
节点
属性的定义位于
对象.defineProperties()
中,并声称这里的所有声明都是静态的


有没有办法告诉JsDoc这个属性实际上不是静态的?我只能找到标签
@static
,它的作用正好相反。

有@instance,请参阅

//编辑:工作示例

/**
 * @constructor
 */
function Graph() {
    var nodes = [];
    Object.defineProperties(this, {
        /**
         * An array of all node handles in the graph
         * @return {Array}
         * @memberof Graph
         * @instance
         */
        nodes: {
            get: function() {
                var ids = [];
                for (var id in nodes) {
                    ids.push(id);
                }
                return ids;
            }
        }
    });
}

我更新了我的答案,希望能更彻底地回答这个问题。JSDoc的3.3.0版产生了预期的输出。仍然不起作用,但很可能是因为过时的版本。我有2.4.0。将更新和测试再次更新它做的把戏!除了修复它,生成的文档看起来更好!谢谢