Static variables

staticread onlyasyncIterator:Symbol

A method that returns the default AsyncIterator for an object.

staticread onlyhasInstance:Symbol

A method determining if a constructor object recognizes an object as its instance. Used by instanceof.

staticread onlyisConcatSpreadable:Symbol

A Boolean value indicating if an object should be flattened to its array elements. Used by Array.prototype.concat().

staticread onlyiterator:Symbol

A method returning the default iterator for an object.

staticread onlymatch:Symbol

A method that matches against a string, also used to determine if an object may be used as a regular expression. Used by String.prototype.match().

staticread onlyreplace:Symbol

A method that replaces matched substrings of a string. Used by String.prototype.replace().

staticread onlysearch:Symbol

A method that returns the index within a string that matches the regular expression. Used by String.prototype.search().

staticread onlyspecies:Symbol

A constructor function that is used to create derived objects.

staticread onlysplit:Symbol

A method that splits a string at the indices that match a regular expression. Used by String.prototype.split().

staticread onlytoPrimitive:Symbol

A method converting an object to a primitive value.

staticread onlytoStringTag:Symbol

A string value used for the default description of an object. Used by Object.prototype.toString().

staticread onlyunscopables:Symbol

An object value of whose own and inherited property names are excluded from the with environment bindings of the associated object.

Static methods

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

The Symbol.for(key) method searches for existing symbols in a runtime-wide symbol registry with the given key and returns it if found. Otherwise a new symbol gets created in the global symbol registry with this key.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/for

statickeyFor(sym:Symbol):Null<String>

The Symbol.keyFor(sym) method retrieves a shared symbol key from the global symbol registry for the given symbol.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/keyFor

Constructor

@:selfCallnew(?description:String)

To create a new primitive symbol, use new Symbol() with an optional string as its description. NOTE: Unlike in plain JavaScript, new Symbol() syntax is used in Haxe. This generates a Symbol(...) expression as required by the JavaScript specification.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol

Methods

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

Retrieve symbol from a given object.

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

toString():String

Returns a string containing the description of the Symbol.