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

Function makeBridgedFunctionClassDef

valdi/src/valdi/quickjs/QuickJSUtils.cpp:92–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 }
91
92 auto result = functionData->callback(functionData->nativeClass->getOpaque().get(), callContext);
93 if (VALDI_LIKELY(exceptionTracker)) {
94 return JS_DupValue(context, fromValdiJSValue(result.get()));
95 }
96 return onJsCallError(context, exceptionTracker);
97}
98
99static JSValue callNativeClassConstructor(
100 JSContext* context, JSValueConst funcObject, JSValueConst newTarget, int argc, JSValueConst* argv, int flags) {
101 if ((flags & JS_CALL_FLAG_CONSTRUCTOR) == 0) {
102 return JS_ThrowTypeError(context, "Native class constructor must be called with new");

Callers 1

Calls 1

newClassDefWithIdFunction · 0.85

Tested by

no test coverage detected