JS_SaveExceptionState

  • Revision slug: SpiderMonkey/JSAPI_Reference/JS_SaveExceptionState
  • Revision title: JS_SaveExceptionState
  • Revision id: 146762
  • Created:
  • Creator: MMondor
  • Is current revision? No
  • Comment New page: <breadcrumbs></breadcrumbs> <title-override>JS_SaveExceptionState</title-override> {{jsapiref}} = Summary = Saves the exception state from the specified context. = Syntax = <pre> JSExcep...

Revision Content

{{template.Jsapiref()}}

Summary

Saves the exception state from the specified context.

Syntax

JSExceptionState *
JS_SaveExceptionState(JSContext *cx);
Name Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.

Description

Saves the current exception state (that is, any pending exception, or a cleared exception state) associated with the specified context cx. Returns a JSExceptionState object holding this state.

That object may then be used to restore again the context using JS_RestoreExceptionState function.

The object may be destroyed using the JS_DropExceptionState function.

Note that this function automatically roots any pending exception object which needs to be protected from the GC.

The function returns NULL if the engine was not built with support for exeptions.

See Also

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

JSExceptionState, JS_RestoreExceptionState, JS_DropExceptionState

Revision Source

<p> 
{{template.Jsapiref()}}
</p>
<h2 name="Summary"> Summary </h2>
<p>Saves the exception state from the specified context.
</p>
<h2 name="Syntax"> Syntax </h2>
<pre>JSExceptionState *
JS_SaveExceptionState(JSContext *cx);
</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>
</tbody></table>
<h2 name="Description"> Description </h2>
<p>Saves the current exception state (that is, any pending exception, or a cleared exception state) associated with the specified context <code>cx</code>.
Returns a <code><a href="en/JSExceptionState">JSExceptionState</a></code> object holding this state.
</p><p>That object may then be used to restore again the context using <code><a href="en/JS_RestoreExceptionState">JS_RestoreExceptionState</a></code> function.
</p><p>The object may be destroyed using the <code><a href="en/JS_DropExceptionState">JS_DropExceptionState</a></code> function.
</p><p>Note that this function automatically roots any pending exception object which needs to be protected from the GC.
</p><p>The function returns <code>NULL</code> if the engine was not built with support for exeptions.
</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_SaveExceptionState", "LXR ID Search")}}</td>
</tr>
<tr>
<td>Entries</td>
<td>
<p><a href="en/JSExceptionState">JSExceptionState</a>,
<a href="en/JS_RestoreExceptionState">JS_RestoreExceptionState</a>,
<a href="en/JS_DropExceptionState">JS_DropExceptionState</a>
</p>
</td>
</tr>
</tbody></table>
Revert to this revision