on master help sign in
Fix bug with log function
commit142c2c026133f0255c99aab07f171e65b4aafd66 authorEvan Czaplicki <info@elm-lang.org> dateSat 8 Mar 2014, 07:37 (13 years ago) parentc920e00
1 file changed+5−3
libraries/Native/Debug.js+5−3
libraries/Native/Debug.js+5−3
@@ -7,10 +7,12 @@ Elm.Native.Debug.make = function(elm) {
77 var show = Elm.Native.Show.make(elm).show;
88
99 function log(tag,value) {
10− if (process && process.stdout) {
11− process.stdout.write(tag + ': ' + show(value));
10+ var msg = tag + ': ' + show(value);
11+ var process = process || {};
12+ if (process.stdout) {
13+ process.stdout.write(msg);
1214 } else {
13− console.log(tag + ': ' + show(value));
15+ console.log(msg);
1416 }
1517 return value;
1618 }