Skip to content

Commit 032ed12

Browse files
author
Max Schaefer
committed
JavaScript: Use in-dist trap cache when extracting externs.
1 parent 63933cd commit 032ed12

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,16 @@ public void run() throws IOException {
374374
*/
375375
private void extractExterns() throws IOException {
376376
ExtractorConfig config = new ExtractorConfig(false).withExterns(true);
377+
378+
// use explicitly specified trap cache, or otherwise $SEMMLE_DIST/.cache/trap-cache/javascript,
379+
// which we pre-populate when building the distribution
380+
ITrapCache trapCache = this.trapCache;
381+
if (trapCache instanceof DummyTrapCache) {
382+
Path trapCachePath = SEMMLE_DIST.resolve(".cache").resolve("trap-cache").resolve("javascript");
383+
if (Files.isDirectory(trapCachePath))
384+
trapCache = new DefaultTrapCache(trapCachePath.toString(), null, Main.EXTRACTOR_VERSION);
385+
}
386+
377387
FileExtractor extractor = new FileExtractor(config, outputConfig, trapCache, extractorState);
378388
FileVisitor<? super Path> visitor = new SimpleFileVisitor<Path>() {
379389
@Override

0 commit comments

Comments
 (0)