Function js::jsapi::GetFirstArgumentAsTypeHint [] [src]

pub unsafe extern "C" fn GetFirstArgumentAsTypeHint(
    cx: *mut JSContext,
    args: CallArgs,
    result: *mut JSType
) -> bool

If args.get(0) is one of the strings "string", "number", or "default", set *result to JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID accordingly and return true. Otherwise, return false with a TypeError pending.

This can be useful in implementing a @@toPrimitive method.