mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 14:57:56 +00:00
Add the revive tests in the browsers (#158)
This commit is contained in:
committed by
GitHub
parent
7f81f37e0c
commit
939138d0cd
+44
-28
@@ -1,35 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Web Worker Example</title>
|
||||
<style>
|
||||
/* Ensure the pre tag wraps long lines */
|
||||
pre {
|
||||
white-space: pre-wrap; /* Wrap long lines */
|
||||
word-wrap: break-word; /* Break long words */
|
||||
max-width: 100%; /* Optional: Ensures it doesn't overflow container */
|
||||
overflow-wrap: break-word; /* Another method for wrapping */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Web Worker Example</title>
|
||||
<style>
|
||||
/* Ensure the pre tag wraps long lines */
|
||||
pre {
|
||||
white-space: pre-wrap; /* Wrap long lines */
|
||||
word-wrap: break-word; /* Break long words */
|
||||
max-width: 100%; /* Optional: Ensures it doesn't overflow container */
|
||||
overflow-wrap: break-word; /* Another method for wrapping */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Revive Compilation Output</h1>
|
||||
<pre id="output"></pre>
|
||||
<script>
|
||||
var outputElement = document.getElementById('output');
|
||||
var worker = new Worker('./worker.js');
|
||||
worker.addEventListener('message', function (e) {
|
||||
const output = e.data.output
|
||||
outputElement.textContent = output;
|
||||
}, false);
|
||||
<body>
|
||||
<h1>Revive Compilation Output</h1>
|
||||
<pre id="output"></pre>
|
||||
<script>
|
||||
var outputElement = document.getElementById('output');
|
||||
var worker = new Worker('./worker.js');
|
||||
const standardJsonInput = {
|
||||
language: 'Solidity',
|
||||
sources: {
|
||||
contract: {
|
||||
content: 'contract MyContract { function f() public { } }',
|
||||
}
|
||||
},
|
||||
settings: {
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 200,
|
||||
},
|
||||
outputSelection: {
|
||||
'*': {
|
||||
'*': ['abi'],
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
worker.addEventListener('message', function (e) {
|
||||
outputElement.textContent = e.data.output;
|
||||
}, false);
|
||||
|
||||
worker.postMessage({
|
||||
contractCode: 'contract C { function f() public { } }',
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
worker.postMessage(JSON.stringify(standardJsonInput));
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user