@protected¶
-
.. @protected::¶ - 语法
@protected [{typeExpression}]- 概述
With the JSDoc tag dictionary (enabled by default): @protected With the Closure Compiler tag dictionary:
The
@protectedtag marks a symbol as protected. Typically, this tag indicates that a symbol is only available, or should only be used, within the current module.By default, symbols marked with the
@protectedtag will appear in your documentation. In JSDoc 3.3.0 and later, you can use the-a/--accessJSDoc的命令行参数 to change this behavior.The
@protectedtag is equivalent to@access protected.- 示例
In the following example, the instance member
Thingy#_barappears in the generated documentation, but with an annotation indicating that it is protected:Using the @protected tag¶/** @constructor */ function Thingy() { /** @protected */ this._bar = 1; }