mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 19:38:01 +00:00
JS: Fix encoding conversion from utf16 to utf8 (#131)
This commit is contained in:
committed by
GitHub
parent
2cb8f82266
commit
afe44ad21b
@@ -29,24 +29,10 @@ onmessage = async function (e) {
|
||||
m.soljson = Module;
|
||||
|
||||
// Set input data for stdin
|
||||
m.setStdinData(JSON.stringify(sourceCode));
|
||||
|
||||
var stdoutString = "";
|
||||
m.setStdoutCallback(function(char) {
|
||||
if (char.charCodeAt(0) === '\n') {
|
||||
console.log("new line")
|
||||
exit
|
||||
}
|
||||
stdoutString += char;
|
||||
});
|
||||
|
||||
var stderrString = "";
|
||||
m.setStderrCallback(function(char) {
|
||||
stderrString += char;
|
||||
});
|
||||
m.writeToStdin(JSON.stringify(sourceCode));
|
||||
|
||||
// Compile the Solidity source code
|
||||
m.callMain(['--standard-json']);
|
||||
|
||||
postMessage({output: stdoutString || stderrString});
|
||||
postMessage({output: m.readFromStdout() || m.readFromStderr()});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user