JS_SetCheckObjectAccessCallback

  • Revision slug: SpiderMonkey/JSAPI_Reference/JS_SetCheckObjectAccessCallback
  • Revision title: JS_SetCheckObjectAccessCallback
  • Revision id: 138889
  • Created:
  • Creator: Jorend
  • Is current revision? No
  • Comment 16 words added, 1 words removed

Revision Content

{{ deprecated_header() }}

{{ jsapi_maxversion_header("1.8") }}

Set the runtime-wide check-object-access callback. This function is deprecated. In SpiderMonkey 1.8.1 and later, use JS_SetRuntimeSecurityCallbacks instead.

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 sets the runtime-wide 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 check-object-access callback.

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

Revision Source

<p>{{ deprecated_header() }}</p>
<p>{{ jsapi_maxversion_header("1.8") }}</p>
<p>Set the runtime-wide check-object-access callback. This function is deprecated. In SpiderMonkey 1.8.1 and later, use <a class="internal" href="/En/SpiderMonkey/JSAPI%20Reference/JS%20GetSecurityCallbacks" title="En/SpiderMonkey/JSAPI Reference/JS GetSecurityCallbacks"><code>JS_SetRuntimeSecurityCallbacks</code></a> instead.</p>
<h2 name="Syntax">Syntax</h2>
<pre class="eval"><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.checkAccess" title="en/JSClass.checkAccess">JSCheckAccessOp</a> <strong>JS_SetCheckObjectAccessCallback</strong>(
    <a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSRuntime</a> *rt, <a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.checkAccess" title="en/JSClass.checkAccess">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/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSRuntime</a> *</code></td> <td>The runtime to configure.</td> </tr> <tr> <td><code>acb</code></td> <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.checkAccess" title="en/JSClass.checkAccess">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> sets the runtime-wide check-object-access callback, which is used as the fallback <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSClass.checkAccess" title="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 check-object-access callback.</p>
<p>{{ LXRSearch("ident", "i", "JS_SetCheckObjectAccessCallback") }}</p>
Revert to this revision