1
我得到以下在一個特定的JavaScript文件爲什麼「可選參數名稱%s必須以opt_爲前綴。」在gjslint - 嚴格模式下?
Line 23, E:0233: Optional parameter name category must be prefixed with opt_.
Line 649, E:0233: Optional parameter name animate must be prefixed with opt_.
Line 697, E:0233: Optional parameter name aggregate must be prefixed with opt_.
Line 763, E:0233: Optional parameter name animate must be prefixed with opt_.
Line 796, E:0233: Optional parameter name animate must be prefixed with opt_.
對於第一個代碼是:
/** @constructor
*
* @param {Object} data an entity or item.
* @param {Object} parent a viewObj, or at the root level, a viewstate.
* @param {Array.<number>} position an (x$, y$) pair.
* @param {string=} category The category to give the item. This forms an
* inconsistent mess around where category is stored.
*/
function ViewObj(data, parent, position, category) {
有什麼錯誤代碼的意義呢? 'category'是不是可選!
啊,好吧,嗯。有時間臉紅。謝謝。 – bugmagnet 2013-04-11 03:52:58