//closure
//out.print("(function () {");
//out.newline();
// grab compilation result
Set<CompilationResult> results = artifacts.find(CompilationResult.class);
CompilationResult result = null;
if (results.size() > 1) {
logger.log(TreeLogger.ERROR,
"The module must have exactly one distinct"
+ " permutation when using the " + getDescription()
+ " Linker.", null);
throw new UnableToCompleteException();
} else if (!results.isEmpty()) {
result = results.iterator().next();
// dump JS
String[] js = result.getJavaScript();
if (js.length != 1) {
logger.log(TreeLogger.ERROR,
"The module must not have multiple fragments when using the "
+ getDescription() + " Linker.", null);
throw new UnableToCompleteException();