func:  CClosure::ClosureStub(ffi_cif* cif, void* result, void** args, void* userData) ClosureInfo * cinfo = static_cast < ClosureInfo * > userData JSContext * cx = cinfo -> cx ; RootedObject typeObj ( cx , cinfo -> typeObj ) ; RootedObject thisObj ( cx , cinfo -> thisObj ) ; RootedValue jsfnVal ( cx , ObjectValue ( * cinfo -> jsfnObj ) ) ; FunctionInfo * fninfo = FunctionType :: GetFunctionInfo ( typeObj ) ; TypeCode typeCode = CType :: GetTypeCode ( fninfo -> mReturnType ) ;  CType::GetTypeCode(JSObject* typeObj) jsval result = JS_GetReservedSlot ( typeObj , SLOT_TYPECODE ) ; return TypeCode ( result . toInt32 ( ) ) ; if ( cif -> rtype != & ffi_type_void )  rvSize = cif -> rtype -> size; switch ( typeCode )  #undef INTEGRAL_CASE rvSize = Align ( rvSize , sizeof ( ffi_arg ) ) ; static MOZ_ALWAYS_INLINE Align(size_t val, size_t align) return ( ( val - 1 ) | ( align - 1 ) ) + 1 ; memset ( result , 0 , rvSize ); JS :: AutoValueVector argv ( cx ) ; if ( ! argv . resize ( cif -> nargs ) )  for (uint32_t i = 0; i < cif->nargs; ++i) RootedObject argType ( cx , fninfo -> mArgTypes [ i ] ) ; if ( ! ConvertToJS ( cx , argType , NullPtr ( ) , args [ i ] , false , false , argv [ i ] ) )  RootedValue rval ( cx ) ; bool success = JS_CallFunctionValue ( cx , thisObj , jsfnVal , argv , & rval ) ; if ( success && cif -> rtype != & ffi_type_void )  success = ImplicitConvert ( cx , rval , fninfo -> mReturnType , result , false , nullptr ); static ImplicitConvert(JSContext* HandleValue JSObject* void* bool bool* freePointer) RootedObject targetType ( cx , targetType_ ) ; RootedObject valObj ( cx , nullptr ) ; if ( val . isObject ( ) )  valObj = & val . toObject ( ); if ( CData :: IsCData ( valObj ) )  sourceData = valObj; sourceType = CData :: GetCType ( sourceData ); if ( CType :: TypesEqual ( sourceType , targetType ) )  size_t size = CType :: GetSize ( sourceType ) ; memmove ( buffer , CData :: GetData ( sourceData ) , size ); 