Testing and conversion functions between a JS ID and an integer.

Syntax

bool
JSID_IS_INT(jsid id);

int32_t
JSID_TO_INT(jsid id);

bool
INT_FITS_IN_JSID(int32_t i);

jsid
INT_TO_JSID(int32_t i);
Name Type Description
id jsid The property identifier to test or convert.
i int32_t An integer to test or convert.

Description

JSID_IS_INT tests whether a specified JS ID, id, is an integer, and returns true if it's an integer.

JSID_TO_INT converts a specified JS ID, id to an integer.

INT_FITS_IN_JSID tests whether a specified integer fits in jsid, it means the integer value is not negative.

INT_TO_JSID converts a specified integer, i to a jsid.

See Also