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

Function getBridgedFunctionClassDef

valdi/src/valdi/quickjs/QuickJSUtils.cpp:101–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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");
103 }
104 if (JS_VALUE_GET_PTR(funcObject) != JS_VALUE_GET_PTR(newTarget)) {
105 return JS_ThrowTypeError(context, "Native class subclassing is not supported");
106 }
107
108 auto& valdiJsContext = *getValdiJSContext(context);

Callers 3

setObjectCallableFunction · 0.85
getObjectCallableFunction · 0.85
onInitializeMethod · 0.85

Calls 1

Tested by

no test coverage detected