JSVAL_TO_INT

  • Revision slug: SpiderMonkey/JSAPI_Reference/JSVAL_TO_INT
  • Revision title: JSVAL_TO_INT
  • Revision id: 146479
  • Created:
  • Creator: Jorend
  • Is current revision? No
  • Comment no wording changes; page display name changed to 'JSVAL_TO_INT'

Revision Content

{{ Jsapi_ref_header("JSVAL_TO_INT") }}

Converts an integer jsval to a C integer without any type checking or error handling.

Syntax

JSVAL_TO_INT(v)

Description

JSVAL_TO_INT converts a specified integer jsval, v, to the corresponding C integer value. If v is any other type of value, the result is unspecified.

Note that although jsval is an integer type, it must be treated as opaque. The jsval encoding of the integer 4, for instance, is not ((jsval) 4) but some other pattern of bits.

To convert an integer to jsval, use INT_FITS_IN_JSVAL and INT_TO_JSVAL.

{{ LXRSearch("ident", "i", "JSVAL_TO_INT") }}

Revision Source

<p>{{ Jsapi_ref_header("JSVAL_TO_INT") }}
</p><p>Converts an integer <code><a href="/en/jsval" title="en/jsval">jsval</a></code> to a C integer without any type checking or error handling.
</p>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval"><strong>JSVAL_TO_INT</strong>(v)
</pre>
<h3 name="Description"> Description </h3>
<p><code>JSVAL_TO_INT</code> converts a specified integer <code><a href="/en/jsval" title="en/jsval">jsval</a></code>, <code>v</code>, to the corresponding C integer value. If <code>v</code> is any other type of value, the result is unspecified.
</p><p>Note that although <code>jsval</code> is an integer type, it must be treated as opaque. The <code>jsval</code> encoding of the integer <code>4</code>, for instance, is not <code>((jsval) 4)</code> but some other pattern of bits.
</p><p>To convert an integer to <code>jsval</code>, use <code><a href="/en/INT_FITS_IN_JSVAL" title="en/INT_FITS_IN_JSVAL">INT_FITS_IN_JSVAL</a></code> and <code><a href="/en/INT_TO_JSVAL" title="en/INT_TO_JSVAL">INT_TO_JSVAL</a></code>.
</p><p>{{ LXRSearch("ident", "i", "JSVAL_TO_INT") }}
</p>
Revert to this revision