Call the onmessage function with data
| 32 | return JavaScriptANRAttribution::boundedLabel(STRING_FORMAT("worker.{}({})", operation, path)); |
| 33 | } |
| 34 | |
| 35 | Ref<JavaScriptRuntime> JavaScriptWorker::getWorkerRuntime() const { |
| 36 | return _workerRuntime; |
| 37 | } |
| 38 | |
| 39 | static JSValueRef getGlobalOnMessage(JavaScriptEntryParameters& entry) { |
| 40 | auto globalObj = entry.jsContext.getGlobalObject(entry.exceptionTracker); |
| 41 | auto onMessageKey = STRING_LITERAL("onmessage"); |
| 42 | auto onmessage = |
| 43 | entry.jsContext.getObjectProperty(globalObj.get(), onMessageKey.toStringView(), entry.exceptionTracker); |
| 44 | return entry.jsContext.isValueFunction(onmessage.get()) ? std::move(onmessage) : entry.jsContext.newUndefined(); |
| 45 | } |
no test coverage detected