【发布时间】:2015-01-03 06:47:42
【问题描述】:
在如下代码上运行 jsdoc 时,@param 文档将被忽略。我认为这是因为我在 IIFE 中返回函数,但考虑到这在 JS 中的常见模式,我很难相信 jsdoc 无法处理它。
/** @namespace */
var util = {
/**
* Repeat <tt>str</tt> several times.
* @param {google.maps.Marker} str The string to repeat.
* @param {number} [times=1] How many times to repeat the string.
* @returns {string}
*/
repeat: (function() {
var magicNumber = 1;
return function(str, times) {
if (times === undefined || times < magicNumber) {
times = magicNumber;
}
return new Array(times+1).join(str);
};
}())
};
【问题讨论】:
标签: jsdoc