Class: Visit

Eleven~ Visit

Base class with methods to validate and visit a tree. Private method names start with an underscore.


new Visit()

Properties:
Name Type Description
trace RegExp

selects matching tags to trace visits.

errors number

count of calls to _error().

Source:

Methods


_dump(node [, shallow])

Creates a deep display of a node.

Parameters:
Name Type Argument Description
node Array

to recursively traverse.

shallow number <optional>

limits depth if non-negative, by default unlimited.

Source:

_error()

Displays and counts an error message.

Source:

_tree(node)

Recursively checks tree tags, throws an error if there is a problem.

Parameters:
Name Type Description
node Array

to validate.

Source:

visit(node [, trace])

Visits a (valid!) tree node, returns either node itself or the result of calling tag as method for an array.

Parameters:
Name Type Argument Description
node Array

to visit, using the tag as a method name and the node as argument.

trace RegExp <optional>

sets .trace if specified.

Source: