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

Method doSetHostOnMessage

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

Source from the content-addressed store, hash-verified

111 // - close
112 // - location, https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation, only href and search are populated
113 _workerRuntime->setValueToGlobalObject(STRING_LITERAL("onmessage"), Value::undefined());
114 auto postMessageFunc = [weakSelf](const ValueFunctionCallContext& callContext) -> Value {
115 auto self = weakSelf.lock();
116 if (self && self->isRunning()) {
117 auto hostRuntime = Ref<JavaScriptRuntime>(self->_hostRuntime.lock());
118 if (hostRuntime == nullptr) {

Callers 1

setHostOnMessageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected