mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 20:48:01 +00:00
19 lines
401 B
JavaScript
19 lines
401 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()});
|
|
};
|