<commit_before>'use strict';

var NodeVisitor = function ( traversalMode ) {
    /*jshint bitwise: false */
    this.traversalMask = ~0x0;
    /*jshint bitwise: true */
    this.nodeMaskOverride = 0;
    this.traversalMode = traversalMode;
    if ( traversalMode === undefined ) {
        this.traversalMode = NodeVisitor.TRAVERSE_ALL_CHILDREN;
    }
    this.nodePath = [];
    this.visitorType = NodeVisitor.NODE_VISITOR;
    this._databaseRequestHandler = undefined;
    this._frameStamp = undefined;
};

//NodeVisitor.TRAVERSE_NONE = 0;
NodeVisitor.TRAVERSE_PARENTS = 1;
NodeVisitor.TRAVERSE_ALL_CHILDREN = 2;
NodeVisitor.TRAVERSE_ACTIVE_CHILDREN = 3;

NodeVisitor.NODE_VISITOR = 0;
NodeVisitor.UPDATE_VISITOR = 1;
NodeVisitor.CULL_VISITOR = 2;

// =================== Traversal functions ===============
var traverseParents = function traverseParents( node ) {
    node.ascend( this );
};

var traverseChildren = function traverseAllChildren( node ) {
    node.traverse( this );
};

// must be sync with TRAVERSE_ENUMS
NodeVisitor._traversalFunctions = [
    undefined,
    traverseParents,<commit_msg>Inlines NodeVisitor functions from traverse type<commit_after>'use strict';

var NodeVisitor = function ( traversalMode ) {
    /*jshint bitwise: false */
    this.traversalMask = ~0x0;
    /*jshint bitwise: true */
    this.nodeMaskOverride = 0;
    this.traversalMode = traversalMode;
    if ( traversalMode === undefined ) {
        this.traversalMode = NodeVisitor.TRAVERSE_ALL_CHILDREN;
    }
    this.nodePath = [];
    this.visitorType = NodeVisitor.NODE_VISITOR;
    this._databaseRequestHandler = undefined;
    this._frameStamp = undefined;

    this.traverse = NodeVisitor._traversalFunctions[ this.traversalMode ];
    this.pushOntoNodePath = NodeVisitor._pushOntoNodePath[ this.traversalMode ];
    this.popFromNodePath = NodeVisitor._popFromNodePath[ this.traversalMode ];
};

//NodeVisitor.TRAVERSE_NONE = 0;
NodeVisitor.TRAVERSE_PARENTS = 1;
NodeVisitor.TRAVERSE_ALL_CHILDREN = 2;
NodeVisitor.TRAVERSE_ACTIVE_CHILDREN = 3;

NodeVisitor.NODE_VISITOR = 0;
NodeVisitor.UPDATE_VISITOR = 1;
NodeVisitor.CULL_VISITOR = 2;

// =================== Traversal functions ===============
var traverseParents = function traverseParents( node ) {
    node.ascend( this );
};

var traverseChildren = function traverseAllChildren( node ) {
    node.traverse( this );
};

// must be sync with TRAVERSE_ENUMS
NodeVisitor._traversalFunctions = [
    undefined,
    traverseParents,
{'fraction_non_alphanumeric': 0.12434607645875252, 'fraction_numerical': 0.008048289738430584, 'mean_word_length': 4.255813953488372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3485707', 'n_tokens_mistral': 842, 'n_tokens_neox': 801, 'n_words': 149}