|
|
@ -116,7 +116,7 @@ editor.getSession().setMode("ace/mode/javascript"); |
|
|
|
editor.getSession().setTabSize(4); |
|
|
|
editor.getSession().setTabSize(4); |
|
|
|
editor.getSession().setUseSoftTabs(true); |
|
|
|
editor.getSession().setUseSoftTabs(true); |
|
|
|
|
|
|
|
|
|
|
|
var compileString = Module.cwrap("compileString", "string", ["string"]); |
|
|
|
var compileString = Module.cwrap("compileString", "string", ["string", "number"]); |
|
|
|
var previousInput = ''; |
|
|
|
var previousInput = ''; |
|
|
|
var outputArea = document.querySelector('#output'); |
|
|
|
var outputArea = document.querySelector('#output'); |
|
|
|
var onChange = function() { |
|
|
|
var onChange = function() { |
|
|
@ -126,7 +126,7 @@ var onChange = function() { |
|
|
|
return; |
|
|
|
return; |
|
|
|
previousInput = input; |
|
|
|
previousInput = input; |
|
|
|
try { |
|
|
|
try { |
|
|
|
outputArea.innerHTML = compileString(input, optimize); |
|
|
|
outputArea.innerHTML = compileString(input, optimize ? 1 : 0); |
|
|
|
} catch (exception) { |
|
|
|
} catch (exception) { |
|
|
|
outputArea.innerHTML = "Uncaught JavaScript Exception:\n" + exception; |
|
|
|
outputArea.innerHTML = "Uncaught JavaScript Exception:\n" + exception; |
|
|
|
} |
|
|
|
} |
|
|
|