private RhinoScriptBuilder initScriptBuilder() {
    // TODO: Find a way to encapsulate this code
    RhinoScriptBuilder builder = null;
    try {
      if (scope == null) {
        builder = RhinoScriptBuilder.newChain().addJSON().evaluateChain(UglifyJs.class.getResourceAsStream("init.js"),
            "initScript").evaluateChain(getScriptAsStream(), DEFAULT_UGLIFY_JS);
        scope = builder.getScope();
      } else {
        builder = RhinoScriptBuilder.newChain(scope);
      }
      return builder;
    } catch (final Exception ex) {
      throw new IllegalStateException("Failed initializing js", ex);
    }
  }
private RhinoScriptBuilder initScriptBuilder() {
    
    RhinoScriptBuilder builder = null;
    try {
      if (scope == null) {
        builder = RhinoScriptBuilder.newChain().addJSON().evaluateChain(UglifyJs.class.getResourceAsStream("init.js"),
            "initScript").evaluateChain(getScriptAsStream(), DEFAULT_UGLIFY_JS);
        scope = builder.getScope();
      } else {
        builder = RhinoScriptBuilder.newChain(scope);
      }
      return builder;
    } catch (final Exception ex) {
      throw new IllegalStateException("Failed initializing js", ex);
    }
  }
private RhinoScriptBuilder initScriptBuilder ( ) { // TODO: Find a way to encapsulate this code
 RhinoScriptBuilder builder = null ; try { if ( scope == null ) { builder = RhinoScriptBuilder . newChain ( ) . addJSON ( ) . evaluateChain ( UglifyJs . class . getResourceAsStream ( "init.js" ) , "initScript" ) . evaluateChain ( getScriptAsStream ( ) , DEFAULT_UGLIFY_JS ) ; scope = builder . getScope ( ) ; } else { builder = RhinoScriptBuilder . newChain ( scope ) ; } return builder ; } catch ( final Exception ex ) { throw new IllegalStateException ( "Failed initializing js" , ex ) ; } }
Initialize script builder for evaluation.
Initialize script builder for evaluation .