JS_GetFunctionId

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

Revision Content

{{ Jsapi_ref_header("JS_GetFunctionId") }}

Get a function's name as a JSString.

Syntax

JSString * JS_GetFunctionId(JSFunction *fun);
Name Type Description
fun JSFunction * A JavaScript function.

Description

JS_GetFunctionId returns the name of a function, fun, as a JSString, or NULL if fun is unnamed. The returned string is guaranteed to live as long as fun, so the application often does not need to root the string.

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

Revision Source

<p>{{ Jsapi_ref_header("JS_GetFunctionId") }}
</p><p>Get a function's name as a <code><a href="/en/JSString" title="en/JSString">JSString</a></code>.
</p>
<h2 name="Syntax"> Syntax </h2>
<pre class="eval"><a href="/en/JSString" title="en/JSString">JSString</a> * <strong>JS_GetFunctionId</strong>(<a href="/en/JSFunction" title="en/JSFunction">JSFunction</a> *fun);
</pre>
<table class="fullwidth-table">
<tbody><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td><code>fun</code></td>
<td><code><a href="/en/JSFunction" title="en/JSFunction">JSFunction</a> *</code></td>
<td>A JavaScript function.</td>
</tr>
</tbody></table>
<h2 name="Description"> Description </h2>
<p><code>JS_GetFunctionId</code> returns the name of a function, <code>fun</code>, as a <code><a href="/en/JSString" title="en/JSString">JSString</a></code>, or <code>NULL</code> if <code>fun</code> is unnamed. The returned string is guaranteed to live as long as <code>fun</code>, so the application often does not need to root the string.
</p><p>{{ LXRSearch("ident", "i", "JS_GetFunctionId") }}
</p>
Revert to this revision