aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-31 17:19:14 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-31 17:19:14 -0800
commitd1d6cbf8701b204bf379c6d94bb15d52f6f003aa (patch)
tree8c801949722e1c8c4561ed80f61bebf4c2f76387 /tests
parenteceba2944f95058ecc432e016652ffdb09c46e6b (diff)
override print() by default, to avoid errors when using the browser print() (print to printer) if it hasn't been overridden. Overriding is now possible through Module.print
Diffstat (limited to 'tests')
-rw-r--r--tests/hello_world.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/hello_world.js b/tests/hello_world.js
index 091b10fc..e6fcf070 100644
--- a/tests/hello_world.js
+++ b/tests/hello_world.js
@@ -41,11 +41,7 @@ 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) {
+ print = printErr = function(x) {
console.log(x);
};