public String generateSourceMap ( ) throws IOException { final String sourceMethod = "generateSourceMap" ; //$NON-NLS-1$ final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { name } ) ; } String result = null ; lineLengths = getLineLengths ( ) ; Compiler compiler = new Compiler ( ) ; sgen = new SourceMapGeneratorV3 ( ) ; compiler . initOptions ( compiler_options ) ; currentLine = currentChar = 0 ; Node node = compiler . parse ( JSSourceFile . fromCode ( name , source ) ) ; if ( compiler . hasErrors ( ) ) { if ( log . isLoggable ( Level . WARNING ) ) { JSError [ ] errors = compiler . getErrors ( ) ; for ( JSError error : errors ) { log . logp ( Level . WARNING , sourceClass , sourceMethod , error . toString ( ) ) ; } } } if ( node != null ) { processNode ( node ) ; StringWriter writer = new StringWriter ( ) ; sgen . appendTo ( writer , name ) ; result = writer . toString ( ) ; } sgen = null ; lineLengths = null ; if ( isTraceLogging ) { log . exiting ( sourceClass , sourceMethod , result ) ; } return result ; }
Generate the identity source map and return the result .