class AliasStrings {
/**
* Creates an instance.
*
* @param compiler The compiler
* @param moduleGraph The module graph, or null if there are no modules
* @param strings Set of strings to be aliased. If null, all strings except
* 'undefined' will be aliased.
* @param blacklistRegex The regex to blacklist words in aliasing strings.
* @param outputStringUsage Outputs all strings and the number of times they
* were used in the application to the server log.
*/
AliasStrings(AbstractCompiler compiler,
JSModuleGraph moduleGraph,
Set<String> strings,
String blacklistRegex,
boolean outputStringUsage) {
this.compiler = compiler;
this.moduleGraph = moduleGraph;
this.aliasableStrings = strings;
if (blacklistRegex.length() != 0) {
this.blacklist = Pattern.compile(blacklistRegex).matcher("");
} else {
this.blacklist = null;
}
this.outputStringUsage = outputStringUsage;
}
}