【发布时间】:2012-07-25 03:27:26
【问题描述】:
我正在使用 Google Closure Tools 中的 gjslint 工具清理我的代码。它正在报告以下错误:
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 吗?谢谢!
【问题讨论】:
-
我怀疑这是因为它只是“按惯例私有”(例如,不是私有关闭)。
-
有什么区别?我不认为任何注释都是可执行的。
-
但看起来 gslint 正在尝试 ;-) 也许那个“错误”可以降级为警告?还是
@private改变了闭包编译器的输出/启发式?
标签: javascript google-closure google-closure-library gjslint