Javascript 未分析jsdoc字段
为什么jsdoc会忽略我的字段Javascript 未分析jsdoc字段,javascript,field,documentation,jsdoc,jsdoc3,Javascript,Field,Documentation,Jsdoc,Jsdoc3,为什么jsdoc会忽略我的字段 /** * Matrix object for operations on matrices * @constructor * @param {number[][]} m - values * @param {number} def - default size def x def */ function Matrix(m, def){ /** number[][] - values */ this.m; /** * number - number of
/**
* Matrix object for operations on matrices
* @constructor
* @param {number[][]} m - values
* @param {number} def - default size def x def
*/
function Matrix(m, def){
/**
number[][] - values
*/
this.m;
/**
* number - number of rows
*/
this.rows;
/**
* number - number of cols
*/
this.cols;
if(m != null){
this.m = m;
this.rows = m[0].length;
this.cols = m.length;
}
else {
this.m = new Array(def);
for (var i = 0; i < def; i++) {
this.m[i] = new Array(def);
}
this.rows = def;
this.cols = def;
this.initI();
}
}
/**
* initializes the Matrix as Ident-Matrix
*/
Matrix.prototype.initI = function(){
for(var i = 0; i < this.rows; i++){
for(var j = 0; j < this.cols; j++) {
if(i == j) this.m[i][j] = 1;
else this.m[i][j] = 0;
}
}
}
/**
*矩阵运算的矩阵对象
*@constructor
*@param{number[]]}m-值
*@param{number}def-默认大小def x def
*/
函数矩阵(m,def){
/**
数字[][]-值
*/
这个,m,;
/**
*number-行数
*/
这一行;
/**
*number-列数
*/
这是cols;
如果(m!=null){
这个,m=m;
this.rows=m[0]。长度;
this.cols=m.长度;
}
否则{
this.m=新阵列(def);
对于(变量i=0;i
对象及其函数通常会被解析,但是字段
m
,行
,和cols
被jsdoc忽略
在另一段代码中,我不使用prototype
语法,它通常进行解析。
编辑数字我刚才看到你必须给字段赋值,所以jsdoc解析它
double
和int
不是javascript类型,而是使用number
。我将所有内容都改为number,但仍然找不到它