| 787 | } |
| 788 | auto constructorData = getAttachedNativeClassFunctionData(classObject); |
| 789 | if (constructorData == nullptr) { |
| 790 | exceptionTracker.onError("Value is not a native class"); |
| 791 | return Valdi::JSValueRef(); |
| 792 | } |
| 793 | JSValueRef exception = nullptr; |
| 794 | auto prototypeValue = JSObjectGetProperty( |
| 795 | getJSGlobalContext(), classObject, fromValdiJSPropertyName(_prototypePropertyName.get()), &exception); |
| 796 | if (exception != nullptr) { |
| 797 | storeException(exceptionTracker, exception); |
| 798 | return Valdi::JSValueRef(); |
| 799 | } |
| 800 | auto prototypeObject = JSValueToObject(getJSGlobalContext(), prototypeValue, &exception); |
| 801 | if (exception != nullptr) { |
| 802 | storeException(exceptionTracker, exception); |
| 803 | return Valdi::JSValueRef(); |
| 804 | } |
| 805 | auto instanceData = Valdi::makeShared<Valdi::JSNativeClassInstanceData>(constructorData->nativeClass, opaque); |
| 806 | auto object = |
| 807 | JSObjectMake(getJSGlobalContext(), getWrappedObjectClassRef(), Valdi::unsafeBridgeRetain(instanceData.get())); |
| 808 | JSObjectSetPrototype(getJSGlobalContext(), object, prototypeObject); |
nothing calls this directly
no test coverage detected