From: Dale Weiler Date: Tue, 13 Nov 2012 03:52:19 +0000 (+0000) Subject: Make it node safe X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4f4ef893f4703db95a947ae5536f62626b6f6ce9;p=xonotic%2Fgmqcc.git Make it node safe --- diff --git a/javascripts/vm.js b/javascripts/vm.js index 4b8f77b..ef6617c 100644 --- a/javascripts/vm.js +++ b/javascripts/vm.js @@ -1,29 +1,3 @@ -var Module = { - preRun: [], - noInitialRun: true, - postRun: [], - print: (function() { - var element = document.getElementById('output'); - element.value = ''; // clear browser cache - return function(text) { - // These replacements are necessary if you render to raw HTML - //text = text.replace(/&/g, "&"); - //text = text.replace(//g, ">"); - //text = text.replace('\n', '
', 'g'); - element.value += text + "\n"; - element.scrollTop = 99999; // focus on bottom - }; - })(), - printErr: function(text) { - if (0) { // XXX disabled for safety typeof dump == 'function') { - dump(text + '\n'); // fast, straight to the real console - } else { - console.log(text); - } - } -}; - // Note: Some Emscripten settings will significantly limit the speed of the generated code. // Note: Some Emscripten settings may limit the speed of the generated code. // TODO: " u s e s t r i c t "; diff --git a/test.html b/test.html index a3370cb..8fdd98e 100644 --- a/test.html +++ b/test.html @@ -46,7 +46,8 @@ - Execute: +
+

Execution Output:

@@ -54,6 +55,33 @@ +