Visit Mozilla.org

BOOLEAN TO JSVAL

From MDC

Cast a C integer to a boolean jsval without any type checking or error handling.

[edit] Syntax

BOOLEAN_TO_JSVAL(b)
Name Type Description
b JSBool or int C integer value to be converted to a boolean jsval.

[edit] Description

BOOLEAN_TO_JSVAL converts a JSBool or integer argument, b, to a boolean jsval.

If b is 0 or JS_FALSE, the result is JSVAL_FALSE.

If b is 1 or JS_TRUE, the result is JSVAL_TRUE.

Warning sign
Warning: This macro does not accept all nonzero values as true. The argument b must be 0 or 1, JS_TRUE or JS_FALSE. Otherwise the behavior is undefined.

[edit] See Also

LXR ID Search for BOOLEAN_TO_JSVAL

JSVAL_TO_BOOLEAN