Function mozjs::jsapi::ToPrimitive

source ยท
pub unsafe extern "C" fn ToPrimitive(
    cx: *mut JSContext,
    obj: Handle<*mut JSObject>,
    hint: JSType,
    vp: MutableHandle<Value>,
) -> bool
Expand description

Convert obj to a primitive value. On success, store the result in vp and return true.

The hint argument must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_UNDEFINED (no hint).

Implements: ES6 7.1.1 ToPrimitive(input, [PreferredType]).