aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-07-30 14:22:01 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-07-30 14:22:01 -0700
commit7c43fe1d7865b3da1655d66ee5e95246dafda3ec (patch)
treec08a8f1c7b56f5ec0dab895d3044f0b6c22c5e95
parentd04125d12a2c8656c30dbe58ba82719a361a0580 (diff)
print on the web using console.log
-rw-r--r--src/preamble.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 99288244..d4f5e570 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -549,13 +549,8 @@ function String_copy(ptr, addZero) {
// Tools
-function jrint(label, obj) { // XXX manual debugging
- if (!obj) {
- obj = label;
- label = '';
- } else
- label = label + ' : ';
- print(label + JSON.stringify(obj));
+if (typeof print === 'undefined') {
+ print = console.log; // we are on the web
}
// This processes a JS string into a C-line array of numbers, 0-terminated.