2017-03-30 02:50:05 +09:00
|
|
|
let solc;
|
2017-02-24 22:49:34 -05:00
|
|
|
|
2017-03-30 20:12:39 +09:00
|
|
|
process.on('message', function (msg) {
|
2017-02-24 22:49:34 -05:00
|
|
|
if (msg.action === 'loadCompiler') {
|
2017-07-05 08:35:51 -04:00
|
|
|
solc = require(msg.solcLocation);
|
2017-02-24 22:49:34 -05:00
|
|
|
process.send({result: "loadedCompiler"});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg.action === 'compile') {
|
2017-03-30 02:50:05 +09:00
|
|
|
let output = solc.compile(msg.obj, msg.optimize);
|
2017-02-24 22:49:34 -05:00
|
|
|
process.send({result: "compilation", output: output});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-03-30 20:12:39 +09:00
|
|
|
process.on('exit', function () {
|
2017-02-25 22:39:40 -05:00
|
|
|
process.exit(0);
|
|
|
|
});
|
|
|
|
|