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

Method valueToString

valdi/src/valdi/quickjs/QuickJSJavaScriptContext.cpp:804–817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

802 }
803 if (opaque == nullptr) {
804 exceptionTracker.onError("Native class opaque object cannot be null");
805 return Valdi::JSValueRef();
806 }
807
808 auto prototype = checkCallAndGetValue(exceptionTracker, JS_GetPropertyStr(_context, clsValue, "prototype"));
809 if (!exceptionTracker) {
810 return Valdi::JSValueRef();
811 }
812
813 auto object = checkCallAndGetValue(
814 exceptionTracker, JS_NewObjectProtoClass(_context, fromValdiJSValue(prototype.get()), _wrappedObjectClassID));
815 if (!exceptionTracker) {
816 return Valdi::JSValueRef();
817 }
818
819 auto instanceData = Valdi::makeShared<Valdi::JSNativeClassInstanceData>(nativeClass, opaque);
820 setObjectWrappedObject(fromValdiJSValue(object.get()), instanceData);

Callers

nothing calls this directly

Calls 6

JS_ToCStringLenFunction · 0.85
getGlobalFunction · 0.85
guardMethod · 0.80
makeStringMethod · 0.80
fromValdiJSValueFunction · 0.70
StringBoxClass · 0.50

Tested by

no test coverage detected