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

Method doPostMessage

valdi/src/valdi/runtime/JavaScript/JavaScriptWorker.cpp:117–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115 auto self = weakSelf.lock();
116 if (self && self->isRunning()) {
117 auto hostRuntime = Ref<JavaScriptRuntime>(self->_hostRuntime.lock());
118 if (hostRuntime == nullptr) {
119 return Value::undefined();
120 }
121 auto transfer = callContext.getParametersSize() > 1 ? callContext.getParameter(1) : Value::undefinedRef();
122 auto message = JavaScriptMessage::make(callContext.getParameter(0), transfer, nullptr);
123 if (!message) {
124 callContext.getExceptionTracker().onError(message.moveError());
125 return Value::undefined();

Callers 1

postMessageMethod · 0.95

Calls 2

getGlobalOnMessageFunction · 0.85
dispatchMessageFunction · 0.85

Tested by

no test coverage detected