Created
November 6, 2010 18:50
-
-
Save tschaub/665609 to your computer and use it in GitHub Desktop.
failing compile test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var google = Packages.com.google; | |
var jscomp = google.javascript.jscomp; | |
var ImmutableList = google.common.collect.ImmutableList; | |
var compiler = new jscomp.Compiler(); | |
// assemble compiler options | |
var options = new jscomp.CompilerOptions(); | |
options.setCodingConvention(new jscomp.ClosureCodingConvention()); | |
// set compilation level | |
jscomp.CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options); | |
// assemble externs | |
var externs = ImmutableList.of( | |
jscomp.JSSourceFile.fromCode("extern.js", "") | |
); | |
// assemble inputs | |
var inputs = ImmutableList.of( | |
jscomp.JSSourceFile.fromCode("input.js", "alert('hello')") | |
); | |
// compile | |
var result = compiler.compile(externs, inputs, options); | |
var out = compiler.toSource(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment