Function mozjs_sys::jsapi::JS::ReadableStreamError

source ·
pub unsafe extern "C" fn ReadableStreamError(
    cx: *mut JSContext,
    stream: HandleObject,
    error: HandleValue,
) -> bool
Expand description

Errors the given ReadableStream, causing all future interactions to fail with the given error value.

Throws a TypeError and returns false if the erroring operation fails.

Note: This is semantically equivalent to the |error| method on the stream controller’s prototype in JS. We expose it with the stream itself as a target for simplicity.

Asserts that |stream| is a ReadableStream object or an unwrappable wrapper for one.