Static variables

staticread onlyiterator:Symbol

A method returning the default iterator for an object.

Static methods

@:native("for")staticfor_(key:String):Symbol

Searches for existing symbols with the given key and returns it if found. Otherwise a new symbol gets created in the global symbol registry with this key.

statickeyFor(sym:Symbol):Null<String>

Retrieves a shared symbol key from the global symbol registry for the given symbol.

Constructor

@:selfCallnew(?description:String)

To create a new primitive symbol, you write new Symbol() with an optional string as its description.

NOTE: Unlike plain JavaScript, in Haxe new Symbol() syntax is used, however Symbol(...) expression will be generated as required by JavaScript specification.

Methods

inlineofObject<T>(object:{}):Null<T>

Retrieve symbol from a given object.

NOTE: This is a Haxe-specific method that generates object[symbol] expression.

toString():String

Returns a string containing the description of the Symbol.