Function script::dom::bindings::import::module::jsapi::ReadableStreamError

source ·
pub unsafe extern "C" fn ReadableStreamError(
    cx: *mut JSContext,
    stream: Handle<*mut JSObject>,
    error: Handle<Value>,
) -> 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.