From 4f4ef893f4703db95a947ae5536f62626b6f6ce9 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Tue, 13 Nov 2012 03:52:19 +0000 Subject: [PATCH] Make it node safe --- javascripts/vm.js | 26 -------------------------- test.html | 30 +++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 27 deletions(-) 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 @@ + -- 2.39.2