get_optional_buffer_source

Function get_optional_buffer_source 

Source
fn get_optional_buffer_source(
    cx: &mut JSContext,
    object: HandleObject<'_>,
    parameter: &CStr,
) -> Fallible<Option<Vec<u8>>>
Expand description

Helper to retrieve an optional paramter in BufferSource from WebIDL dictionary, and get a copy of the bytes held by the buffer source according to https://webidl.spec.whatwg.org/#dfn-get-buffer-source-copy