lib/service/BranchedHTMLStore.js
function traverseAst(sourceCode, node, parent, visitor) {
    if (visitor[node.type]) {
        visitor[node.type](node, parent)
    }

    const keys = sourceCode.visitorKeys[node.type]
    for (const key of keys) {
        const child = node[key]

        if (Array.isArray(child)) {
            for (const c of child) {
                if (c) {
                    traverseAst(sourceCode, c, node, visitor)
                }
            }
        } else if (child) {
            traverseAst(sourceCode, child, node, visitor)
        }
    }
}
function traverseAst(sourceCode, node, parent, visitor) {
    if (visitor[node.type]) {
        visitor[node.type](node, parent)
    }

    const keys = sourceCode.visitorKeys[node.type]
    for (const key of keys) {
        const child = node[key]

        if (Array.isArray(child)) {
            for (const c of child) {
                if (c) {
                    traverseAst(sourceCode, c, node, visitor)
                }
            }
        } else if (child) {
            traverseAst(sourceCode, child, node, visitor)
        }
    }
}
function traverseAst ( sourceCode , node , parent , visitor ) { if ( visitor [ node . type ] ) { visitor [ node . type ] ( node , parent ) } const keys = sourceCode . visitorKeys [ node . type ] for ( const key of keys ) { const child = node [ key ] if ( Array . isArray ( child ) ) { for ( const c of child ) { if ( c ) { traverseAst ( sourceCode , c , node , visitor ) } } } else if ( child ) { traverseAst ( sourceCode , child , node , visitor ) } } }
Traverse the given node.
@param {SourceCode} sourceCode The source code.
@param {object} node The node to traverse.
@param {object} parent The parent node.
@param {object} visitor Visitor.
@returns {void}
Traverse the given node .