@@ -179,12 +179,16 @@ function addReceivers(ports) {
179179 ports.log.subscribe(function(v) { console.log(v) });
180180 }
181181 if ('stdout' in ports) {
182− var handler = process ? function(v) { process.stdout.write(v); }
182+ var process = process || {};
183+ var handler = process.stdout
184+ ? function(v) { process.stdout.write(v); }
183185 : function(v) { console.log(v); };
184186 ports.stdout.subscribe(handler);
185187 }
186188 if ('stderr' in ports) {
187− var handler = process ? function(v) { process.stderr.write(v); }
189+ var process = process || {};
190+ var handler = process.stderr
191+ ? function(v) { process.stderr.write(v); }
188192 : function(v) { console.log('Error:' + v); };
189193 ports.stderr.subscribe(handler);
190194 }