JavaScript-1.5 Reference

JSVAL_TO_OBJECT Macro

Summary

Casts the type tag for a specified JS value and returns a pointer to the value cast as a JS object.

Syntax

JSVAL_TO_OBJECT(v)

Description

JSVAL_TO_OBJECT clears a specified JS value, v, to a JS object. It does so by casting the value's type tag and casting the result to an object pointer.

Casting v to an object pointer manipulates its underlying type tag. v must be an object jsval. Casting does not convert the value stored in v to a different data type. To perform actual data type conversion, use the JS_ValueToObject function.

Notes

This macro assumes that the JS type tag for v is already JSVAL_OBJECT. Because JS values are represented as bit-shifted C integers, comparisons of JSVAL_TO_OBJECT(v) to v itself are not equal unless you ignore the C pointer type mismatch and v is an object reference.

See Also

Groups [ Macro ]
Documents [ LXR ID Search ]
Entries [ DOUBLE_TO_JSVAL | JSVAL_TO_DOUBLE | JSVAL_TO_GCTHING | JSVAL_TO_STRING | JS_ValueToObject | OBJECT_TO_JSVAL | STRING_TO_JSVAL ]

This page was generated by APIDOC