Function script::dom::bindings::import::module::jsapi::JS::CaptureCurrentStack

source ยท
pub unsafe extern "C" fn CaptureCurrentStack(
    cx: *mut JSContext,
    stackp: MutableHandle<*mut JSObject>,
    capture: *mut [u64; 4],
) -> bool
Expand description

Capture the current call stack as a chain of SavedFrame JSObjects, and set |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there are no JS frames on the stack.

The |capture| parameter describes the portion of the JS stack to capture:

  • |JS::AllFrames|: Capture all frames on the stack.

  • |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the stack.

  • |JS::FirstSubsumedFrame|: Capture the first frame whose principals are subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not consider self-hosted frames; this can be controlled via the |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async stack.