Class KnownSymbolType


public final class KnownSymbolType extends SymbolType
A concrete instance of a JavaScript symbol.

This includes all "well-known" symbols in the spec - Symbol.iterator, Symbol.asyncIterator, etc.

This is analogous to the EnumElementType class - each KnownSymbolType is a subtype of the general symbol type, but unique KnownSymbolTypes are not subtypes of one another.

  • Constructor Details

  • Method Details

    • getDisplayName

      public String getDisplayName()
      Description copied from class: JSType
      Returns a user meaningful label for the JSType instance. For example, Functions and Enums will return their declaration name (if they have one). Some types will not have a meaningful display name. Calls to hasDisplayName() will return true IFF getDisplayName() will return null or a zero length string.
      Overrides:
      getDisplayName in class SymbolType
      Returns:
      the display name of the type, or null if one is not available
    • isKnownSymbolValueType

      public boolean isKnownSymbolValueType()
      Overrides:
      isKnownSymbolValueType in class JSType
    • toMaybeKnownSymbolType

      public KnownSymbolType toMaybeKnownSymbolType()
      Overrides:
      toMaybeKnownSymbolType in class JSType
    • hasDisplayName

      public boolean hasDisplayName()
      Overrides:
      hasDisplayName in class JSType
      Returns:
      true if the JSType has a user meaningful label.
    • getPropertyKind

      public JSType.HasPropertyKind getPropertyKind(Property.Key propertyName, boolean autobox)
      Description copied from class: JSType
      Checks whether the property is present on the object.
      Overrides:
      getPropertyKind in class JSType
      Parameters:
      propertyName - The property name.
      autobox - Whether to check for the presents on an autoboxed type