Record Class JSParserOptions

java.lang.Object
java.lang.Record
com.oracle.truffle.js.runtime.JSParserOptions

public record JSParserOptions(boolean strict, boolean scripting, boolean shebang, int ecmaScriptVersion, boolean syntaxExtensions, boolean constAsVar, boolean functionStatementError, boolean dumpOnError, boolean emptyStatements, boolean annexB, boolean allowBigInt, boolean classFields, boolean importAttributes, boolean privateFieldsIn, boolean topLevelAwait, boolean v8Intrinsics) extends Record
Option values that affect JS language semantics, i.e. how code is parsed and translated. Must be a subset of JSLanguageOptions to ensure that code is only shared between contexts that agree on all these options (but may differ in others that do not affect code and shared state).
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    JSParserOptions(boolean strict, boolean scripting, boolean shebang, int ecmaScriptVersion, boolean syntaxExtensions, boolean constAsVar, boolean functionStatementError, boolean dumpOnError, boolean emptyStatements, boolean annexB, boolean allowBigInt, boolean classFields, boolean importAttributes, boolean privateFieldsIn, boolean topLevelAwait, boolean v8Intrinsics)
    Creates an instance of a JSParserOptions record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the allowBigInt record component.
    boolean
    Returns the value of the annexB record component.
    boolean
    Returns the value of the classFields record component.
    boolean
    Returns the value of the constAsVar record component.
    boolean
    Returns the value of the dumpOnError record component.
    int
    Returns the value of the ecmaScriptVersion record component.
    boolean
    Returns the value of the emptyStatements record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
     
    boolean
    Returns the value of the functionStatementError record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the importAttributes record component.
    boolean
    Returns the value of the privateFieldsIn record component.
    boolean
    Returns the value of the scripting record component.
    boolean
    Returns the value of the shebang record component.
    boolean
    Returns the value of the strict record component.
    boolean
    Returns the value of the syntaxExtensions record component.
    boolean
    Returns the value of the topLevelAwait record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the v8Intrinsics record component.
    withStrict(boolean strict)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JSParserOptions

      public JSParserOptions(boolean strict, boolean scripting, boolean shebang, int ecmaScriptVersion, boolean syntaxExtensions, boolean constAsVar, boolean functionStatementError, boolean dumpOnError, boolean emptyStatements, boolean annexB, boolean allowBigInt, boolean classFields, boolean importAttributes, boolean privateFieldsIn, boolean topLevelAwait, boolean v8Intrinsics)
      Creates an instance of a JSParserOptions record class.
      Parameters:
      strict - the value for the strict record component
      scripting - the value for the scripting record component
      shebang - the value for the shebang record component
      ecmaScriptVersion - the value for the ecmaScriptVersion record component
      syntaxExtensions - the value for the syntaxExtensions record component
      constAsVar - the value for the constAsVar record component
      functionStatementError - the value for the functionStatementError record component
      dumpOnError - the value for the dumpOnError record component
      emptyStatements - the value for the emptyStatements record component
      annexB - the value for the annexB record component
      allowBigInt - the value for the allowBigInt record component
      classFields - the value for the classFields record component
      importAttributes - the value for the importAttributes record component
      privateFieldsIn - the value for the privateFieldsIn record component
      topLevelAwait - the value for the topLevelAwait record component
      v8Intrinsics - the value for the v8Intrinsics record component
  • Method Details

    • fromLanguageOptions

      public static JSParserOptions fromLanguageOptions(JSLanguageOptions options)
    • withStrict

      public JSParserOptions withStrict(boolean strict)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • strict

      public boolean strict()
      Returns the value of the strict record component.
      Returns:
      the value of the strict record component
    • scripting

      public boolean scripting()
      Returns the value of the scripting record component.
      Returns:
      the value of the scripting record component
    • shebang

      public boolean shebang()
      Returns the value of the shebang record component.
      Returns:
      the value of the shebang record component
    • ecmaScriptVersion

      public int ecmaScriptVersion()
      Returns the value of the ecmaScriptVersion record component.
      Returns:
      the value of the ecmaScriptVersion record component
    • syntaxExtensions

      public boolean syntaxExtensions()
      Returns the value of the syntaxExtensions record component.
      Returns:
      the value of the syntaxExtensions record component
    • constAsVar

      public boolean constAsVar()
      Returns the value of the constAsVar record component.
      Returns:
      the value of the constAsVar record component
    • functionStatementError

      public boolean functionStatementError()
      Returns the value of the functionStatementError record component.
      Returns:
      the value of the functionStatementError record component
    • dumpOnError

      public boolean dumpOnError()
      Returns the value of the dumpOnError record component.
      Returns:
      the value of the dumpOnError record component
    • emptyStatements

      public boolean emptyStatements()
      Returns the value of the emptyStatements record component.
      Returns:
      the value of the emptyStatements record component
    • annexB

      public boolean annexB()
      Returns the value of the annexB record component.
      Returns:
      the value of the annexB record component
    • allowBigInt

      public boolean allowBigInt()
      Returns the value of the allowBigInt record component.
      Returns:
      the value of the allowBigInt record component
    • classFields

      public boolean classFields()
      Returns the value of the classFields record component.
      Returns:
      the value of the classFields record component
    • importAttributes

      public boolean importAttributes()
      Returns the value of the importAttributes record component.
      Returns:
      the value of the importAttributes record component
    • privateFieldsIn

      public boolean privateFieldsIn()
      Returns the value of the privateFieldsIn record component.
      Returns:
      the value of the privateFieldsIn record component
    • topLevelAwait

      public boolean topLevelAwait()
      Returns the value of the topLevelAwait record component.
      Returns:
      the value of the topLevelAwait record component
    • v8Intrinsics

      public boolean v8Intrinsics()
      Returns the value of the v8Intrinsics record component.
      Returns:
      the value of the v8Intrinsics record component