Search in sources :

Example 1 with ModuleMetadataMap

use of com.google.javascript.jscomp.modules.ModuleMetadataMap in project closure-compiler by google.

the class GatherModuleMetadata method process.

@Override
public void process(Node externs, Node root) {
    NodeTraversal.traverse(compiler, externs, new Finder());
    NodeTraversal.traverse(compiler, root, new Finder());
    compiler.setModuleMetadataMap(new ModuleMetadataMap(modulesByPath, modulesByGoogNamespace));
}
Also used : ModuleMetadataMap(com.google.javascript.jscomp.modules.ModuleMetadataMap)

Example 2 with ModuleMetadataMap

use of com.google.javascript.jscomp.modules.ModuleMetadataMap in project closure-compiler by google.

the class CheckClosureImportsTest method getProcessor.

@Override
protected CompilerPass getProcessor(Compiler compiler) {
    ModuleMetadata testMetadata = ModuleMetadata.builder().addGoogNamespace("test").moduleType(moduleType).usesClosure(true).isTestOnly(false).build();
    ModuleMetadataMap metadata = useDefaultModuleMetadata ? new ModuleMetadataMap(ImmutableMap.of(PROVIDES_SYMBOL_PATH, PROVIDES_SYMBOL_METADATA, ES_MODULE_PATH, ES_MODULE_METADATA, TEST_CODE_PATH, testMetadata, "externs", EXTERN_METADATA), ImmutableMap.of("symbol", PROVIDES_SYMBOL_METADATA, "es.module", ES_MODULE_METADATA, "test", testMetadata)) : compiler.getModuleMetadataMap();
    return new CheckClosureImports(compiler, metadata);
}
Also used : ModuleMetadataMap(com.google.javascript.jscomp.modules.ModuleMetadataMap) ModuleMetadata(com.google.javascript.jscomp.modules.ModuleMetadataMap.ModuleMetadata)

Aggregations

ModuleMetadataMap (com.google.javascript.jscomp.modules.ModuleMetadataMap)2 ModuleMetadata (com.google.javascript.jscomp.modules.ModuleMetadataMap.ModuleMetadata)1