mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-10 05:56:00 +00:00
19 lines
391 B
JavaScript
19 lines
391 B
JavaScript
let solc;
|
|
|
|
process.on('message', function (msg) {
|
|
if (msg.action === 'loadCompiler') {
|
|
solc = require(msg.solcLocation);
|
|
process.send({result: "loadedCompiler"});
|
|
}
|
|
|
|
if (msg.action === 'compile') {
|
|
let output = solc.compile(msg.obj, msg.optimize);
|
|
process.send({result: "compilation", output: output});
|
|
}
|
|
});
|
|
|
|
process.on('exit', function () {
|
|
process.exit(0);
|
|
});
|
|
|