aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler.js4
-rw-r--r--src/shell.js4
-rw-r--r--tests/hello_world.js4
3 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler.js b/src/compiler.js
index 579cd98f..7e3839b6 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -52,6 +52,10 @@ if (ENVIRONMENT_IS_NODE) {
}
} else if (ENVIRONMENT_IS_WEB) {
+ // Warning: We do not override print here, so that you can define it before
+ // this code runs. However, if you do not define it and it is actually
+ // called, it will try to print to a printer, and/or give odd errors.
+
printErr = function(x) {
console.log(x);
};
diff --git a/src/shell.js b/src/shell.js
index 61f2d5cd..850dfd81 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -44,6 +44,10 @@ if (ENVIRONMENT_IS_NODE) {
}
} else if (ENVIRONMENT_IS_WEB) {
+ // Warning: We do not override print here, so that you can define it before
+ // this code runs. However, if you do not define it and it is actually
+ // called, it will try to print to a printer, and/or give odd errors.
+
printErr = function(x) {
console.log(x);
};
diff --git a/tests/hello_world.js b/tests/hello_world.js
index 24bc0fdd..091b10fc 100644
--- a/tests/hello_world.js
+++ b/tests/hello_world.js
@@ -41,6 +41,10 @@ if (ENVIRONMENT_IS_NODE) {
}
} else if (ENVIRONMENT_IS_WEB) {
+ // Warning: We do not override print here, so that you can define it before
+ // this code runs. However, if you do not define it and it is actually
+ // called, it will try to print to a printer, and/or give odd errors.
+
printErr = function(x) {
console.log(x);
};