Class SymbolKey

java.lang.Object
org.mozilla.javascript.SymbolKey
All Implemented Interfaces:
Serializable, Symbol

public class SymbolKey extends Object implements Symbol, Serializable
A SymbolKey is one of the implementations of Symbol. It is really there so that we can easily use pre-defined symbols as keys in native code. A SymbolKey has the special property that two NativeSymbol objects with the same key are equal.
See Also:
  • Field Details

    • ITERATOR

      public static final SymbolKey ITERATOR
    • TO_STRING_TAG

      public static final SymbolKey TO_STRING_TAG
    • SPECIES

      public static final SymbolKey SPECIES
    • HAS_INSTANCE

      public static final SymbolKey HAS_INSTANCE
    • IS_CONCAT_SPREADABLE

      public static final SymbolKey IS_CONCAT_SPREADABLE
    • IS_REGEXP

      public static final SymbolKey IS_REGEXP
    • TO_PRIMITIVE

      public static final SymbolKey TO_PRIMITIVE
    • MATCH

      public static final SymbolKey MATCH
    • MATCH_ALL

      public static final SymbolKey MATCH_ALL
    • REPLACE

      public static final SymbolKey REPLACE
    • SPLIT

      public static final SymbolKey SPLIT
    • UNSCOPABLES

      public static final SymbolKey UNSCOPABLES
  • Constructor Details

    • SymbolKey

      public SymbolKey(String name)
  • Method Details

    • getName

      public String getName()
      Returns the symbol's name. Returns empty string for anonymous symbol (i.e. something created with Symbol()).
    • getDescription

      public Object getDescription()
      Returns the symbol's description - will return Undefined.instance if we have an anonymous symbol (i.e. something created with Symbol()).
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object