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

Function makeWrappedObject

valdi/src/valdi/runtime/JavaScript/JavaScriptUtils.cpp:101–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101JSValueRef makeWrappedObject(IJavaScriptContext& jsContext,
102 const Ref<RefCountable>& wrappedObject,
103 JSExceptionTracker& exceptionTracker,
104 bool attachToContext) {
105 if (attachToContext) {
106 auto attachedRef = makeShared<ContextAttachedValdiObject>(Ref(Context::currentRoot()), wrappedObject);
107 return jsContext.newWrappedObject(attachedRef, exceptionTracker);
108 } else {
109 return jsContext.newWrappedObject(wrappedObject, exceptionTracker);
110 }
111}
112
113Ref<RefCountable> unwrapWrappedObject(IJavaScriptContext& jsContext,
114 const JSValue& jsValue,

Callers 10

proxyObjectToJSValueFunction · 0.85
valueToJSValueFunction · 0.85
runtimeGetCSSModuleMethod · 0.85
runtimeGetAssetsMethod · 0.85
setValueForObjectKeyMethod · 0.85
createArenaMethod · 0.85

Calls 2

RefInterface · 0.50
newWrappedObjectMethod · 0.45

Tested by

no test coverage detected