Please note, this is a STATIC archive of website from 03 Nov 2016, does not collect or store any user information, there is no "phishing" involved.


This article needs a technical review. How you can help.

Testing and conversion functions between a JS ID and a JS string.


JSID_IS_STRING(jsid id);

JSString *
JSID_TO_STRING(jsid id);

INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str); // Added in SpiderMonkey 38

JSFlatString *
JSID_TO_FLAT_STRING(jsid id); // Added in SpiderMonkey 17
Name Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext.
id jsid The property identifier to test or convert.
str JSString * An interned string to convert to an id.


JSID_IS_STRING tests whether a specified JS ID, id, is a string, and returns true if it's a string.

JSID_TO_STRING converts a specified JS ID, id to a JSString *.

INTERNED_STRING_TO_JSID converts a specified interned string, str to a jsid.

JSID_TO_FLAT_STRING converts a specified JS ID, id to a JSFlatString *.

See Also

Document Tags and Contributors

 Contributors to this page: kscarfone, arai
 Last updated by: kscarfone,