JS_SetCheckObjectAccessCallback

  • Revision slug: SpiderMonkey/JSAPI_Reference/JS_SetCheckObjectAccessCallback
  • Revision title: JS_SetCheckObjectAccessCallback
  • Revision id: 138883
  • Created:
  • Creator: Jorend
  • Is current revision? No
  • Comment trivia

Revision Content

{{template.Jsapi_ref_header("JS_SetCheckObjectAccessCallback")}}

Set the runtime-wide check-object-access callback.

Syntax

JSCheckAccessOp JS_SetCheckObjectAccessCallback(
    JSRuntime *rt, JSCheckAccessOp acb);
Name Type Description
rt JSRuntime * The runtime to configure.
acb JSCheckAccessOp The new check-object-access callback.

Description

JS_SetCheckObjectAccessCallback allows the application to set the check-object-access callback, which is used as the fallback JSClass.checkAccess method for all classes that leave the checkAccess field NULL. This callback is also used to check access to the caller property of function objects (as, for example, when the JavaScript engine creates a stack trace) and to check access from scripts to properties with scripted getters or setters.

JS_SetCheckObjectAccessCallback returns the previous object access callback.

{{template.LXRSearch("ident", "i", "JS_SetCheckObjectAccessCallback")}}

Revision Source

<p>{{template.Jsapi_ref_header("JS_SetCheckObjectAccessCallback")}}
</p><p>Set the runtime-wide check-object-access callback.
</p>
<h2 name="Syntax"> Syntax </h2>
<pre class="eval"><a href="en/JSCheckAccessOp">JSCheckAccessOp</a> <b>JS_SetCheckObjectAccessCallback</b>(
    <a href="en/JSRuntime">JSRuntime</a> *rt, <a href="en/JSCheckAccessOp">JSCheckAccessOp</a> acb);
</pre>
<table class="fullwidth-table">
<tbody><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td><code>rt</code></td>
<td><code><a href="en/JSRuntime">JSRuntime</a> *</code></td>
<td>The runtime to configure.</td>
</tr>
<tr>
<td><code>acb</code></td>
<td><code><a href="en/JSCheckAccessOp">JSCheckAccessOp</a></code></td>
<td>The new check-object-access callback.</td>
</tr>
</tbody></table>
<h2 name="Description"> Description </h2>
<p><code>JS_SetCheckObjectAccessCallback</code> allows the application to set the check-object-access callback, which is used as the fallback <code><a href="en/JSClass.checkAccess">JSClass.checkAccess</a></code> method for all classes that leave the <code>checkAccess</code> field <code>NULL</code>.  This callback is also used to check access to the <code>caller</code> property of function objects (as, for example, when the JavaScript engine creates a stack trace) and to check access from scripts to properties with scripted getters or setters.
</p><p><code>JS_SetCheckObjectAccessCallback</code> returns the previous object access callback.
</p><p>{{template.LXRSearch("ident", "i", "JS_SetCheckObjectAccessCallback")}}
</p>
Revert to this revision