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

Function makeWrappedObjectClassDef

valdi/src/valdi/quickjs/QuickJSUtils.cpp:107–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 if (JS_VALUE_GET_PTR(funcObject) != JS_VALUE_GET_PTR(newTarget)) {
106 return JS_ThrowTypeError(context, "Native class subclassing is not supported");
107 }
108
109 auto& valdiJsContext = *getValdiJSContext(context);
110 auto nativeClass = getNativeClassConstructorData(funcObject);
111 auto constructor = nativeClass->getConstructor();
112 if (constructor == nullptr) {
113 return JS_ThrowTypeError(context, "Native class cannot be constructed from JavaScript");
114 }
115
116 Valdi::JSValueRef arguments[argc];

Callers 1

getWrappedObjectClassDefFunction · 0.85

Calls 1

newClassDefWithIdFunction · 0.85

Tested by

no test coverage detected