From b76644ee46d9d0a204e2c20a1a19e146e2e98e79 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Fri, 8 Mar 2013 16:36:04 -0700 Subject: [PATCH] forcing a trampoline whenever IO to the browser occurs; otherwise the browser can become unresponsive when printing a tight loop. --- whalesong/js-assembler/runtime-src/baselib-ports.js | 8 +++++++- whalesong/js-assembler/runtime-src/runtime.js | 4 ---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/whalesong/js-assembler/runtime-src/baselib-ports.js b/whalesong/js-assembler/runtime-src/baselib-ports.js index f50683d..3a9ac82 100644 --- a/whalesong/js-assembler/runtime-src/baselib-ports.js +++ b/whalesong/js-assembler/runtime-src/baselib-ports.js @@ -20,6 +20,9 @@ MACHINE.params['currentDisplayer'](MACHINE, domNode); $(domNode).trigger({type : 'afterAttach'}); $('*', domNode).trigger({type : 'afterAttach'}); + // Force a trampoline to send control back to the browser + // for rendering. + MACHINE.cbt=0; }; var StandardErrorPort = function () { @@ -30,6 +33,9 @@ MACHINE.params['currentErrorDisplayer'](MACHINE, domNode); $(domNode).trigger({type : 'afterAttach'}); $('*', domNode).trigger({type : 'afterAttach'}); + // Force a trampoline to send control back to the browser + // for rendering. + MACHINE.cbt=0; }; @@ -141,4 +147,4 @@ exports.StandardInputPort = StandardInputPort; -}(this.plt.baselib, $)); \ No newline at end of file +}(this.plt.baselib, $)); diff --git a/whalesong/js-assembler/runtime-src/runtime.js b/whalesong/js-assembler/runtime-src/runtime.js index f31cee4..a182dcf 100644 --- a/whalesong/js-assembler/runtime-src/runtime.js +++ b/whalesong/js-assembler/runtime-src/runtime.js @@ -774,9 +774,6 @@ // Executes all programs that have been labeled as a main module var invokeMains = function(machine, succ, fail) { runtime.ready(function () { - if (window.console && window.console.log) { - window.console.log("invoking main modules"); - } setReadyFalse(); machine = machine || runtime.currentMachine; succ = succ || function() {}; @@ -1174,7 +1171,6 @@ var makeLocalFileModuleLoader = function(moduleManifest) { var loadScript = baselib.loadscript.loadScript; return function(M, moduleName, success, fail) { - console.log("request to load", moduleName); if (M.modules[moduleName] instanceof ModuleRecord) { return success();