internal void AnyTranslator(IntPtr isolate, ISetValueToJs setValueApi, IntPtr holder, object obj) { if (obj == null) { setValueApi.SetNull(isolate, holder); } else { Type realType = obj.GetType(); if (realType == typeof(object)) { int typeId = typeRegister.GetTypeId(isolate, realType); int objectId = objectPool.FindOrAddObject(obj); setValueApi.SetObject(isolate, holder, typeId, new IntPtr(objectId)); } else { GetTranslateFunc(realType)(isolate, setValueApi, holder, obj); } } }
internal IntPtr InvokeConstructor(IntPtr isolate, int callbackIdx, IntPtr info, int paramLen) { object obj = constructorCallbacks[callbackIdx](isolate, info, paramLen); if (obj == null) { return(IntPtr.Zero); } int objectId = objectPool.FindOrAddObject(obj); return(new IntPtr(objectId)); }