Struct mozjs::jsapi::AutoSaveExceptionState [] [src]

#[repr(C)]
pub struct AutoSaveExceptionState { pub context: *mut JSContext, pub wasPropagatingForcedReturn: bool, pub wasOverRecursed: bool, pub wasThrowing: bool, pub exceptionValue: RootedValue, }

Save and later restore the current exception state of a given JSContext. This is useful for implementing behavior in C++ that's like try/catch or try/finally in JS.

Typical usage:

bool ok = JS::Evaluate(cx, ...);
AutoSaveExceptionState savedExc(cx);
... cleanup that might re-enter JS ...
return ok;

Fields

Methods

impl AutoSaveExceptionState
[src]

[src]

Trait Implementations

impl Debug for AutoSaveExceptionState
[src]

[src]

Formats the value using the given formatter. Read more