MCPcopy Create free account
hub / github.com/Snapchat/Valdi / callObjectAsFunction

Method callObjectAsFunction

valdi/src/valdi/jscore/JavaScriptCoreContext.cpp:768–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766 return Valdi::JSValueRef();
767 }
768 break;
769 }
770 }
771 }
772
773 return cls;
774}
775
776Valdi::JSValueRef JavaScriptCoreContext::newObjectFromNativeClass(const Valdi::Ref<Valdi::RefCountable>& opaque,
777 const Valdi::JSValue& cls,
778 Valdi::JSExceptionTracker& exceptionTracker) {
779 if (opaque == nullptr) {
780 exceptionTracker.onError("Native class opaque object cannot be null");
781 return Valdi::JSValueRef();
782 }
783
784 auto classObject = fromValdiJSValue(cls).asObjectRefOrThrow(*this, exceptionTracker);
785 if (!exceptionTracker) {
786 return Valdi::JSValueRef();
787 }
788 auto constructorData = getAttachedNativeClassFunctionData(classObject);
789 if (constructorData == nullptr) {
790 exceptionTracker.onError("Value is not a native class");

Callers

nothing calls this directly

Calls 5

asObjectRefOrThrowMethod · 0.80
getParameterSizeMethod · 0.80
getParameterMethod · 0.80
asObjectRefMethod · 0.80
fromValdiJSValueFunction · 0.70

Tested by

no test coverage detected