MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / workerFunc

Function workerFunc

www/js/_hyperscript-max.js:11449–11486  ·  view source on GitHub ↗
(self2)

Source from the content-addressed store, hash-verified

11447 // src/ext/worker.js
11448 var invocationIdCounter = 0;
11449 var workerFunc = function(self2) {
11450 self2.onmessage = function(e) {
11451 switch (e.data.type) {
11452 case "init":
11453 self2.importScripts(e.data._hyperscript);
11454 self2.importScripts.apply(self2, e.data.extraScripts);
11455 const _hyperscript2 = self2["_hyperscript"];
11456 var hyperscript = _hyperscript2.parse(e.data.src);
11457 hyperscript.apply(self2, self2);
11458 postMessage({ type: "didInit" });
11459 break;
11460 case "call":
11461 try {
11462 var result = self2["_hyperscript"].internals.runtime.getHyperscriptFeatures(self2)[e.data.function].apply(self2, e.data.args);
11463 Promise.resolve(result).then(function(value) {
11464 postMessage({
11465 type: "resolve",
11466 id: e.data.id,
11467 value
11468 });
11469 }).catch(function(error) {
11470 postMessage({
11471 type: "reject",
11472 id: e.data.id,
11473 error: error.toString()
11474 });
11475 });
11476 } catch (error) {
11477 postMessage({
11478 type: "reject",
11479 id: e.data.id,
11480 error: error.toString()
11481 });
11482 }
11483 break;
11484 }
11485 };
11486 };
11487 var workerCode = "(" + workerFunc.toString() + ")(self)";
11488 var blob = new Blob([workerCode], { type: "text/javascript" });
11489 var workerUri = URL.createObjectURL(blob);

Callers

nothing calls this directly

Calls 5

applyMethod · 0.45
parseMethod · 0.45
resolveMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected