Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 86a7fa3

Browse files
author
Max Schaefer
committed
JavaScript: Make extractor default to ECMA 2019.
Also introduces an enum constant for ECMA 2020 (not used anywhere yet).
1 parent 9653fbd commit 86a7fa3

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

change-notes/support/versions-compilers.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ COBOL,ANSI 85 or newer [1]_.,Not applicable,"``.cbl``, ``.CBL``, ``.cpy``, ``.CP
1111
Java,"Java 6 to 11 [2]_.","javac (OpenJDK and Oracle JDK)
1212
1313
Eclipse compiler for Java (ECJ) batch compiler",``.java``
14-
JavaScript,ECMAScript 2018 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhm``, ``.xhtml``, ``.vue``, ``.json`` [3]_."
14+
JavaScript,ECMAScript 2019 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhm``, ``.xhtml``, ``.vue``, ``.json`` [3]_."
1515
Python,"2.7, 3.5, 3.6, 3.7",Not applicable,``.py``
1616
TypeScript [4]_.,"2.6-3.4",Standard TypeScript compiler,"``.ts``, ``.tsx``"

javascript/extractor/src/com/semmle/jcorn/Options.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void call(
5151
private Function<SyntaxError, ?> onRecoverableError;
5252

5353
public Options() {
54-
this.ecmaVersion = 7;
54+
this.ecmaVersion = 10;
5555
this.sourceType = "script";
5656
this.onInsertedSemicolon = null;
5757
this.onTrailingComma = null;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public static enum ECMAVersion {
3434
ECMA2016(2016, 7),
3535
ECMA2017(2017, 8),
3636
ECMA2018(2018, 9),
37-
ECMA2019(2019, 10);
37+
ECMA2019(2019, 10),
38+
ECMA2020(2020, 11);
3839

3940
private final int version;
4041
public final int legacyVersion;
@@ -236,7 +237,7 @@ public String toString() {
236237
private String defaultEncoding;
237238

238239
public ExtractorConfig(boolean experimental) {
239-
this.ecmaVersion = experimental ? ECMAVersion.ECMA2019 : ECMAVersion.ECMA2018;
240+
this.ecmaVersion = experimental ? ECMAVersion.ECMA2020 : ECMAVersion.ECMA2019;
240241
this.platform = Platform.AUTO;
241242
this.jsx = true;
242243
this.sourceType = SourceType.AUTO;

0 commit comments

Comments
 (0)