mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-10-20 18:56:17 +00:00
Emscripten 4.0.12 introduced breaking change by changing module factory to always return promise even if `WASM_ASYNC_COMPILATION=0`. To overcome this, build emscripten compiler without MODULARIZE with custom export of `createRevive`.
15 lines
334 B
JavaScript
15 lines
334 B
JavaScript
importScripts("./resolc_web.js");
|
|
|
|
// Handle messages from the main thread
|
|
onmessage = 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() });
|
|
};
|