Function js::jsapi::JS_BufferIsCompilableUnit [] [src]

pub unsafe extern "C" fn JS_BufferIsCompilableUnit(
    cx: *mut JSContext,
    obj: Handle<*mut JSObject>,
    utf8: *const c_char,
    length: usize
) -> bool

Given a buffer, return false if the buffer might become a valid javascript statement with the addition of more lines. Otherwise return true. The intent is to support interactive compilation - accumulate lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to the compiler.