2017-03-29 17:50:05 +00:00
|
|
|
let solc;
|
2017-02-25 03:49:34 +00:00
|
|
|
|
|
|
|
process.on('message', function(msg) {
|
|
|
|
if (msg.action === 'loadCompiler') {
|
|
|
|
solc = require('solc');
|
|
|
|
process.send({result: "loadedCompiler"});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg.action === 'compile') {
|
2017-03-29 17:50:05 +00:00
|
|
|
let output = solc.compile(msg.obj, msg.optimize);
|
2017-02-25 03:49:34 +00:00
|
|
|
process.send({result: "compilation", output: output});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-02-26 03:39:40 +00:00
|
|
|
process.on('exit', function() {
|
|
|
|
process.exit(0);
|
|
|
|
});
|
|
|
|
|