Skip to main content

allocate_class_id

Function allocate_class_id 

Source
pub fn allocate_class_id() -> ClassId
Expand description

Allocate a class id (JS_NewClassID).

Starts at 1: zero is JS_INVALID_CLASS_ID, and JS_GetOpaque(val, 0) has to match nothing. Needs no runtime, which is what makes it callable from a module’s JS_InitClass before any context exists.