* Gets or creates a CompilationResult for the given JavaScript program.
*/
public StandardCompilationResult getCompilation(TreeLogger logger,
FileBackedObject<PermutationResult> resultFile)
throws UnableToCompleteException {
PermutationResult permutationResult = resultFile.newInstance(logger);
byte[][] js = permutationResult.getJs();
String strongName = Util.computeStrongName(js);
StandardCompilationResult result = resultsByStrongName.get(strongName);
if (result == null) {
result = new StandardCompilationResult(strongName, js,
permutationResult.getSerializedSymbolMap(),
permutationResult.getStatementRanges(), permutationResult.getPermutationId());
resultsByStrongName.put(result.getStrongName(), result);
artifacts.add(result);
// Add any other Permutations
ArtifactSet otherArtifacts = permutationResult.getArtifacts();
if (otherArtifacts != null) {
artifacts.addAll(otherArtifacts);
}
}
return result;