private void processNode ( Node node ) throws IOException { for ( Node cursor = node . getFirstChild ( ) ; cursor != null ; cursor = cursor . getNext ( ) ) { int lineno = cursor . getLineno ( ) - 1 ; // adjust for rhino line numbers being 1 based int charno = cursor . getCharno ( ) ; if ( lineno > currentLine || lineno == currentLine && charno > currentChar ) { currentLine = lineno ; currentChar = charno ; } FilePosition endPosition = getEndPosition ( cursor ) ; sgen . addMapping ( name , null , new FilePosition ( currentLine , currentChar ) , new FilePosition ( currentLine , currentChar ) , endPosition ) ; if ( cursor . hasChildren ( ) ) { processNode ( cursor ) ; } } }
Recursively processes the input node adding a mapping for the node to the source map generator .