MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / fn

Function fn

vm/ByteCodeTranslator/src/javascript/browser_bridge.js:598–619  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

596 return workerCallbackProxies[callbackId];
597 }
598 var fn = function(event) {
599 var target = global.__parparWorker;
600 if (!target || typeof target.postMessage !== 'function') {
601 return;
602 }
603 var payload;
604 try {
605 payload = serializeEventForWorker(event);
606 } catch (err) {
607 payload = null;
608 }
609 try {
610 target.postMessage({
611 type: 'worker-callback',
612 callbackId: callbackId,
613 args: [payload]
614 });
615 } catch (err) {
616 diag('FIRST_FAILURE', 'category', 'worker_callback_post_failed');
617 diag('FIRST_FAILURE', 'message', err && err.message ? err.message : String(err));
618 }
619 };
620 fn.__cn1WorkerCallbackId = callbackId;
621 workerCallbackProxies[callbackId] = fn;
622 return fn;

Callers 11

_dv0Function · 0.70
_dv1Function · 0.70
_dv2Function · 0.70
_dv3Function · 0.70
_dv4Function · 0.70
_dw0Function · 0.70
_dw1Function · 0.70
_dw2Function · 0.70
_dw3Function · 0.70
_dw4Function · 0.70
cn1LinuxRunOnMainAndWaitFunction · 0.50

Calls 4

serializeEventForWorkerFunction · 0.85
diagFunction · 0.85
StringClass · 0.50
postMessageMethod · 0.45

Tested by

no test coverage detected