Files
revive/js/examples/web/worker.js
T
2025-01-23 11:59:50 +01:00

17 lines
389 B
JavaScript

importScripts("./soljson.js");
importScripts("./resolc.js");
// Handle messages from the main thread
onmessage = async function (e) {
const m = createRevive();
m.soljson = Module;
// Set input data for stdin
m.writeToStdin(e.data);
// Compile the Solidity source code
m.callMain(["--standard-json"]);
postMessage({ output: m.readFromStdout() || m.readFromStderr() });
};