Function NewStringFromLatin1Buffer

Source
pub unsafe extern "C" fn NewStringFromLatin1Buffer(
    cx: *mut JSContext,
    buffer: RefPtr<StringBuffer>,
    length: usize,
) -> *mut JSString
Expand description

Create a new JSString possibly backed by |buffer|. The contents of |buffer| will be interpreted as an array of Latin1 characters.

Note that the returned string is not guaranteed to use |buffer|: as an optimization, this API can return an inline string or a previously allocated string.

Increments the buffer’s refcount iff the JS string holds a reference to it.