aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-27 19:07:13 -0500
committerAlon Zakai <alonzakai@gmail.com>2012-12-27 19:07:13 -0500
commit0bf4db93ed9f57809c75739430bb619a693aed96 (patch)
treef36ba3224f4b2aa2771e6861fe86fb00c08e1037 /src/compiler.js
parent275adcf5ce7729295d0fa706cbb2f45ac0a875ef (diff)
compile and run in compiler.html
Diffstat (limited to 'src/compiler.js')
-rw-r--r--src/compiler.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler.js b/src/compiler.js
index e87ff760..e4bd8964 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -76,10 +76,12 @@ if (ENVIRONMENT_IS_NODE) {
}
} else if (ENVIRONMENT_IS_WEB) {
- this['print'] = printErr = function(x) {
+ printErr = function(x) {
console.log(x);
};
+ if (!this['print']) this['print'] = printErr;
+
this['read'] = function(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);