fs: set encoding on fs.createWriteStream
[platform/upstream/nodejs.git] / test / fixtures / catch-stdout-error.js
1 function write() {
2   try {
3     process.stdout.write('Hello, world\n');
4   } catch (ex) {
5     throw new Error('this should never happen');
6   }
7   setImmediate(function() {
8     write();
9   });
10 }
11
12 process.stdout.on('error', function(er) {
13   console.error(JSON.stringify(er));
14   process.exit(42);
15 });
16
17 write();