bundles/org.eclipse.orion.client.javascript/web/eslint/lib/utils/source-code.js
function(index) {
        var result = null,
            resultParent = null,
            traverser = new Traverser();

        traverser.traverse(this.ast, {
            enter: function(node, parent) {
                if (node.range[0] <= index && index < node.range[1]) {
                    result = node;
                    resultParent = parent;
                } else {
                    this.skip();
                }
            },
            leave: function(node) {
                if (node === result) {
                    this.break();
                }
            }
        });

        return result ? utils.mixin({parent: resultParent}, result) : null; // ORION
    }
function(index) {
        var result = null,
            resultParent = null,
            traverser = new Traverser();

        traverser.traverse(this.ast, {
            enter: function(node, parent) {
                if (node.range[0] <= index && index < node.range[1]) {
                    result = node;
                    resultParent = parent;
                } else {
                    this.skip();
                }
            },
            leave: function(node) {
                if (node === result) {
                    this.break();
                }
            }
        });

        return result ? utils.mixin({parent: resultParent}, result) : null; // ORION
    }
function ( index ) { var result = null , resultParent = null , traverser = new Traverser ( ) ; traverser . traverse ( this . ast , { enter : function ( node , parent ) { if ( node . range [ 0 ] <= index && index < node . range [ 1 ] ) { result = node ; resultParent = parent ; } else { this . skip ( ) ; } } , leave : function ( node ) { if ( node === result ) { this . break ( ) ; } } } ) ; return result ? utils . mixin ( { parent : resultParent } , result ) : null ; // ORION }
Gets the deepest node containing a range index.
@param {int} index Range index of the desired node.
@returns {ASTNode} The node if found or null if not found.
Gets the deepest node containing a range index .