From f7d693d06fc0519ceb34e782215c83f4d76d6cec Mon Sep 17 00:00:00 2001 From: Max Schaefer Date: Fri, 9 Nov 2018 15:53:28 +0000 Subject: [PATCH] JavaScript: Make default extractor options more sensible. We now use module auto-detection and no TypeScript mode. This only affects extern extraction in `AutoBuild`, everything else sets these options explicitly. We currently do not have any ES2015 modules or TypeScript code in our externs, so in practice this is behaviour-preserving. --- .../extractor/src/com/semmle/js/extractor/ExtractorConfig.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/javascript/extractor/src/com/semmle/js/extractor/ExtractorConfig.java b/javascript/extractor/src/com/semmle/js/extractor/ExtractorConfig.java index 9eb384db63a..dfb031021f3 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/ExtractorConfig.java +++ b/javascript/extractor/src/com/semmle/js/extractor/ExtractorConfig.java @@ -162,7 +162,7 @@ public class ExtractorConfig { this.ecmaVersion = experimental ? ECMAVersion.ECMA2019 : ECMAVersion.ECMA2018; this.platform = Platform.AUTO; this.jsx = true; - this.sourceType = SourceType.SCRIPT; + this.sourceType = SourceType.AUTO; this.htmlHandling = HTMLHandling.ELEMENTS; this.tolerateParseErrors = true; if (experimental) { @@ -171,6 +171,7 @@ public class ExtractorConfig { this.esnext = true; this.v8Extensions = true; } + this.typescriptMode = TypeScriptMode.NONE; this.defaultEncoding = StandardCharsets.UTF_8.name(); }