script::dom::bindings::import::module

Function jsid_to_string

Source
pub(crate) unsafe fn jsid_to_string(
    cx: *mut JSContext,
    id: Handle<'_, PropertyKey>,
) -> Option<DOMString>
Expand description

Convert id to a DOMString. Returns None if id is not a string or integer.

Handling of invalid UTF-16 in strings depends on the relevant option.

§Safety

  • cx must point to a non-null, valid JSContext instance.