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
context: *mut JSContext
wasPropagatingForcedReturn: bool
wasOverRecursed: bool
wasThrowing: bool
exceptionValue: RootedValue