Skip to main content

detect_return_value

Function detect_return_value 

Source
pub fn detect_return_value(
    source: &str,
    tree: &Tree,
    start_byte: usize,
    end_byte: usize,
    enclosing_fn_end_byte: Option<usize>,
    lang: LangId,
) -> Result<ReturnKind, ReturnValueError>
Expand description

Detect what the extracted code range should return.

Every live-out binding must be represented in the generated call. Unsupported binding shapes and incompatible JavaScript declaration kinds are rejected rather than allowing an extraction to silently discard caller state.