Files
revive/js/examples/web/worker.js
T
2025-02-11 11:55:24 +01:00

15 lines
340 B
JavaScript

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