JsSymbol Class

A JavaScript symbol. Two symbols are the same value only if they are the same instance.

public sealed class JsSymbol : JsCell
Inheritance
JsCell JsSymbol

Properties

NameDescription
AsyncDisposeGets the well-known symbol Symbol.asyncDispose.
AsyncIteratorGets the well-known symbol Symbol.asyncIterator.
DescriptionGets the description of the symbol, or null (Symbol()).
DisposeGets the well-known symbol Symbol.dispose.
HasInstanceGets the well-known symbol Symbol.hasInstance.
IsConcatSpreadableGets the well-known symbol Symbol.isConcatSpreadable.
IsRegisteredGets whether the symbol is in the global symbol registry of an engine (Symbol.for(), see JsEngine.GetRegisteredSymbol): its JsSymbol.Description is its key (Symbol.keyFor()), and it cannot be held weakly.
IteratorGets the well-known symbol Symbol.iterator.
MatchGets the well-known symbol Symbol.match.
MatchAllGets the well-known symbol Symbol.matchAll.
MetadataGets the well-known symbol Symbol.metadata (the decorators proposal).
ReplaceGets the well-known symbol Symbol.replace.
SearchGets the well-known symbol Symbol.search.
SpeciesGets the well-known symbol Symbol.species.
SplitGets the well-known symbol Symbol.split.
ToPrimitiveGets the well-known symbol Symbol.toPrimitive.
ToStringTagGets the well-known symbol Symbol.toStringTag.
UnscopablesGets the well-known symbol Symbol.unscopables.

AsyncDispose

JsSymbol.cs

Gets the well-known symbol Symbol.asyncDispose.

public static JsSymbol AsyncDispose { get; }

Property value

JsSymbol

AsyncIterator

JsSymbol.cs

Gets the well-known symbol Symbol.asyncIterator.

public static JsSymbol AsyncIterator { get; }

Property value

JsSymbol

Description

JsSymbol.cs

Gets the description of the symbol, or null (Symbol()).

public string? Description { get; }

Property value

string?

Gets the well-known symbol Symbol.dispose.

public static JsSymbol Dispose { get; }

Property value

JsSymbol

HasInstance

JsSymbol.cs

Gets the well-known symbol Symbol.hasInstance.

public static JsSymbol HasInstance { get; }

Property value

JsSymbol

IsConcatSpreadable

JsSymbol.cs

Gets the well-known symbol Symbol.isConcatSpreadable.

public static JsSymbol IsConcatSpreadable { get; }

Property value

JsSymbol

IsRegistered

JsSymbol.cs

Gets whether the symbol is in the global symbol registry of an engine (Symbol.for(), see JsEngine.GetRegisteredSymbol): its JsSymbol.Description is its key (Symbol.keyFor()), and it cannot be held weakly.

public bool IsRegistered { get; }

Property value

bool

Iterator

JsSymbol.cs

Gets the well-known symbol Symbol.iterator.

public static JsSymbol Iterator { get; }

Property value

JsSymbol

Gets the well-known symbol Symbol.match.

public static JsSymbol Match { get; }

Property value

JsSymbol

MatchAll

JsSymbol.cs

Gets the well-known symbol Symbol.matchAll.

public static JsSymbol MatchAll { get; }

Property value

JsSymbol

Metadata

JsSymbol.cs

Gets the well-known symbol Symbol.metadata (the decorators proposal).

public static JsSymbol Metadata { get; }

Property value

JsSymbol

Gets the well-known symbol Symbol.replace.

public static JsSymbol Replace { get; }

Property value

JsSymbol

Gets the well-known symbol Symbol.species.

public static JsSymbol Species { get; }

Property value

JsSymbol

Gets the well-known symbol Symbol.split.

public static JsSymbol Split { get; }

Property value

JsSymbol

ToPrimitive

JsSymbol.cs

Gets the well-known symbol Symbol.toPrimitive.

public static JsSymbol ToPrimitive { get; }

Property value

JsSymbol

ToStringTag

JsSymbol.cs

Gets the well-known symbol Symbol.toStringTag.

public static JsSymbol ToStringTag { get; }

Property value

JsSymbol

Unscopables

JsSymbol.cs

Gets the well-known symbol Symbol.unscopables.

public static JsSymbol Unscopables { get; }

Property value

JsSymbol

Methods

NameDescription
Create(string?)Creates a new symbol (Symbol(description)): it is different from every other symbol, including the symbols with the same description. Unlike the objects, a symbol can be used by several engines.
ToString()Returns Symbol(description) (SymbolDescriptiveString).

Create(string?)

JsSymbol.cs

Creates a new symbol (Symbol(description)): it is different from every other symbol, including the symbols with the same description. Unlike the objects, a symbol can be used by several engines.

public static JsSymbol Create(string? description = null)

Parameters

description string?
The description of the symbol, or null.

Returns

JsSymbol

ToString()

JsSymbol.cs

Returns Symbol(description) (SymbolDescriptiveString).

public override string ToString()

Returns

string