Commit 833f2e5a authored by d11e9's avatar d11e9

save changes even on error

parent bfbbcf0c
......@@ -286,15 +286,19 @@ THE SOFTWARE.
var previousInput = '';
var sourceAnnotations = [];
var compile = function() {
editor.getSession().clearAnnotations();
sourceAnnotations = [];
editor.getSession().removeMarker(errMarkerId);
$('#output').empty();
var input = editor.getValue();
var inputIncludingImports = includeLocalImports( input );
var optimize = document.querySelector('#optimize').checked;
try {
var data = $.parseJSON(compileJSON(inputIncludingImports, optimize ? 1 : 0));
$('#output').empty();
var input = editor.getValue();
window.localStorage.setItem( SOL_CACHE_FILE, input );
var inputIncludingImports = includeLocalImports( input );
var optimize = document.querySelector('#optimize').checked;
try {
var data = $.parseJSON(compileJSON(inputIncludingImports, optimize ? 1 : 0));
} catch (exception) {
renderError("Uncaught JavaScript Exception:\n" + exception);
return;
......@@ -309,11 +313,12 @@ THE SOFTWARE.
renderContracts(data, input);
}
var compileTimeout = null;
var onChange = function() {
var input = editor.getValue();
if (input === "") {
window.localStorage.setItem( SOL_CACHE_FILE, '' )
window.localStorage.setItem( SOL_CACHE_FILE, '' )
return;
}
if (input === previousInput)
......@@ -411,8 +416,6 @@ THE SOFTWARE.
};
var renderContracts = function(data, source) {
window.localStorage.setItem( SOL_CACHE_FILE, source );
$('#output').empty();
for (var contractName in data.contracts) {
var contract = data.contracts[contractName];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment