Package com.google.javascript.jscomp
Enum CompilerOptions.LanguageMode
- java.lang.Object
-
- java.lang.Enum<CompilerOptions.LanguageMode>
-
- com.google.javascript.jscomp.CompilerOptions.LanguageMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CompilerOptions.LanguageMode>
- Enclosing class:
- CompilerOptions
public static enum CompilerOptions.LanguageMode extends java.lang.Enum<CompilerOptions.LanguageMode>
A language mode applies to the whole compilation job. As a result, the compiler does not support mixed strict and non-strict in the same compilation job. Therefore, the 'use strict' directive is ignored when the language mode is not strict.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ECMASCRIPT_2015
ECMAScript standard approved in 2015.ECMASCRIPT_2016
ECMAScript standard approved in 2016.ECMASCRIPT_2017
ECMAScript standard approved in 2017.ECMASCRIPT_2018
ECMAScript standard approved in 2018.ECMASCRIPT_2019
ECMAScript standard approved in 2019.ECMASCRIPT_2020
ECMAScript standard approved in 2020.ECMASCRIPT_2021
ECMAScript standard approved in 2021.ECMASCRIPT_NEXT
ECMAScript features from the upcoming standard.ECMASCRIPT3
90's JavaScriptECMASCRIPT5
Traditional JavaScriptECMASCRIPT5_STRICT
Nitpicky, traditional JavaScriptNO_TRANSPILE
For languageOut only.STABLE
Use stable features.UNSTABLE
For testing only.UNSUPPORTED
For testing only.
-
Field Summary
Fields Modifier and Type Field Description static CompilerOptions.LanguageMode
STABLE_IN
static CompilerOptions.LanguageMode
STABLE_OUT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompilerOptions.LanguageMode
fromString(java.lang.String value)
FeatureSet
toFeatureSet()
static CompilerOptions.LanguageMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CompilerOptions.LanguageMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ECMASCRIPT3
public static final CompilerOptions.LanguageMode ECMASCRIPT3
90's JavaScript
-
ECMASCRIPT5
public static final CompilerOptions.LanguageMode ECMASCRIPT5
Traditional JavaScript
-
ECMASCRIPT5_STRICT
public static final CompilerOptions.LanguageMode ECMASCRIPT5_STRICT
Nitpicky, traditional JavaScript
-
ECMASCRIPT_2015
public static final CompilerOptions.LanguageMode ECMASCRIPT_2015
ECMAScript standard approved in 2015.
-
ECMASCRIPT_2016
public static final CompilerOptions.LanguageMode ECMASCRIPT_2016
ECMAScript standard approved in 2016. Adds the exponent operator (**).
-
ECMASCRIPT_2017
public static final CompilerOptions.LanguageMode ECMASCRIPT_2017
ECMAScript standard approved in 2017. Adds async/await and other syntax
-
ECMASCRIPT_2018
public static final CompilerOptions.LanguageMode ECMASCRIPT_2018
ECMAScript standard approved in 2018. Adds "..." in object literals/patterns.
-
ECMASCRIPT_2019
public static final CompilerOptions.LanguageMode ECMASCRIPT_2019
ECMAScript standard approved in 2019. Adds catch blocks with no error binding.
-
ECMASCRIPT_2020
public static final CompilerOptions.LanguageMode ECMASCRIPT_2020
ECMAScript standard approved in 2020.
-
ECMASCRIPT_2021
public static final CompilerOptions.LanguageMode ECMASCRIPT_2021
ECMAScript standard approved in 2021.
-
ECMASCRIPT_NEXT
public static final CompilerOptions.LanguageMode ECMASCRIPT_NEXT
ECMAScript features from the upcoming standard.
-
STABLE
public static final CompilerOptions.LanguageMode STABLE
Use stable features.
-
NO_TRANSPILE
public static final CompilerOptions.LanguageMode NO_TRANSPILE
For languageOut only. The same language mode as the input.
-
UNSTABLE
public static final CompilerOptions.LanguageMode UNSTABLE
For testing only. Features that can be parsed/checked but cannot necessarily be understood by the rest of the compiler yet.
-
UNSUPPORTED
public static final CompilerOptions.LanguageMode UNSUPPORTED
For testing only. Features that can be parsed but cannot necessarily be understood by the rest of the compiler yet.
-
-
Field Detail
-
STABLE_IN
public static final CompilerOptions.LanguageMode STABLE_IN
-
STABLE_OUT
public static final CompilerOptions.LanguageMode STABLE_OUT
-
-
Method Detail
-
values
public static CompilerOptions.LanguageMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CompilerOptions.LanguageMode c : CompilerOptions.LanguageMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CompilerOptions.LanguageMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromString
public static CompilerOptions.LanguageMode fromString(java.lang.String value)
-
toFeatureSet
public FeatureSet toFeatureSet()
-
-