aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index a39fc515..1623d387 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -337,6 +337,12 @@ function _strlen(ptr) {
PRINTBUFFER = '';
function __print__(text) {
+ if (text === null) {
+ // Flush
+ print(PRINTBUFFER);
+ PRINTBUFFER = '';
+ return;
+ }
// We print only when we see a '\n', as console JS engines always add
// one anyhow.
PRINTBUFFER = PRINTBUFFER + text;