JS_PropertyStub

  • Revision slug: SpiderMonkey/JSAPI_Reference/JS_PropertyStub
  • Revision title: JS_PropertyStub
  • Revision id: 68839
  • Created:
  • Creator: Dria
  • Is current revision? No
  • Comment

Revision Content

{{template.Jsapiref()}}

Summary

Provides a dummy property argument for API routines that requires property information.

Syntax

JSBool JS_PropertyStub(JSContext *cx, JSObject *obj, jsval id, jsval *vp);
Name Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
obj JSObject * Pointer to the object for this stub.
id jsval The ID for the stub.
vp jsval * Pointer to a jsval for the stub.

Description

JS_PropertyStub provides a convenient way to pass a property to an API function that requires one without requiring you to create an actual property definition. This is especially useful for internal operations, such as class definitions. A property stub is a place holder for an actual property assignment function.

As designed, JS_PropertyStub does not use the arguments you pass to it, and simply returns JS_TRUE.

See Also

Groups Functions
Documents {{template.LXRSearch("ident", "i", "JS_PropertyStub", "LXR ID Search")}}
Entries

JS_ConvertStub, JS_EnumerateStub, JS_FinalizeStub, JS_ResolveStub

Revision Source

<p> 
{{template.Jsapiref()}}
</p>
<h2 name="Summary"> Summary </h2>
<p>Provides a dummy property argument for API routines that requires property information.
</p>
<h2 name="Syntax"> Syntax </h2>
<pre>JSBool JS_PropertyStub(JSContext *cx, JSObject *obj, jsval id, jsval *vp);
</pre>
<table class="fullwidth-table">
<tbody><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td><code>cx</code></td>
<td><code>JSContext *</code></td>
<td>Pointer to a JS context from which to derive runtime information.</td>
</tr>
<tr>
<td><code>obj</code></td>
<td><code>JSObject *</code></td>
<td>Pointer to the object for this stub.</td>
</tr>
<tr>
<td><code>id</code></td>
<td><code>jsval</code></td>
<td>The ID for the stub.</td>
</tr>
<tr>
<td><code>vp</code></td>
<td><code>jsval *</code></td>
<td>Pointer to a <code>jsval</code> for the stub.</td>
</tr>
</tbody></table>
<h2 name="Description"> Description </h2>
<p><code>JS_PropertyStub</code> provides a convenient way to pass a property to an API function that requires one without requiring you to create an actual property definition. This is especially useful for internal operations, such as class definitions. A property stub is a place holder for an actual property assignment function.
</p><p>As designed, <code>JS_PropertyStub</code> does not use the arguments you pass to it, and simply returns <code>JS_TRUE</code>.
</p>
<h2 name="See_Also"> See Also </h2>
<table class="fullwidth-table">
<tbody><tr>
<td>Groups</td>
<td><a href="en/JSAPI_Reference#Functions">Functions</a></td>
</tr>
<tr>
<td>Documents</td>
<td>{{template.LXRSearch("ident", "i", "JS_PropertyStub", "LXR ID Search")}}</td>
</tr>
<tr>
<td>Entries</td>
<td>
<p><a href="en/JS_ConvertStub">JS_ConvertStub</a>,
<a href="en/JS_EnumerateStub">JS_EnumerateStub</a>,
<a href="en/JS_FinalizeStub">JS_FinalizeStub</a>,
<a href="en/JS_ResolveStub">JS_ResolveStub</a>
</p>
</td>
</tr>
</tbody></table>
Revert to this revision