For most types, ECMADoc distinguishes between these four visibility types:
- Prototype
- Instance
- Static
- Private
Prototype visibility
These are any members assigned to an object's
prototype.
Array.prototype.contains = function Array$contains(value) { ... }
Instance visibility
These are the members declared on the type itself through the use of keyword
this.
this.source = eventSource;
Static visibility
Static are the members assigned to the type itself, and that can therefore be accessed from scope directly.
Object.serialize = function Object$serialize(object) { ... }
Private visibility
Private are members declared in inner scope and without a public variable pointing to them. Additionally, by using the
@private token ECMADoc can be forced into unconditionally considering a member as private. In the example below,
applyPadding and
applyFormat are private functions:
String.format = function String$format(value)
{
function applyPadding(string, count, character, direction) { ... }
function applyFormat() { ... }
return String(value).replace(String.RX_FORMAT, applyFormat);
}