我正在使用Google Closure工具中的gjslint工具清理我的代码。据报告以下错误:为什么“会员不能有@私人JsDoc”?
Line 15, E:0222: Member "this._dictionary" must not have @private JsDoc
这是代码:
/**
* Stacker class.
* @constructor
* @param {frankenstein.app.Dictionary} dictionary input dictionary for stacking.
*/
frankenstein.app.Stacker = function(dictionary) {
/** @private */ this._dictionary = dictionary;
};
有人可以解释为什么this._dictionary不得有@private JsDoc?谢谢!
我会怀疑这是因为它只是“按照惯例私人”(例如,不是私人的封闭)。 – 2012-07-25 03:42:14
有什么区别?我不认为任何注释是可执行的。 – 2012-07-25 03:55:04
但它看起来像gslint正在尝试;-)也许这个“错误”可以降级为警告?或者'@ private'改变Closure Compiler输出/启发式? – 2012-07-25 04:13:52