| Leo Repp | 58b9f11 | 2021-11-22 11:57:47 +0100 | [diff] [blame^] | 1 | var spawn = require('child_process').spawn; |
| 2 | |||||
| 3 | function loop() { | ||||
| 4 | console.log('starting'); | ||||
| 5 | console.log(this); | ||||
| 6 | //var child = spawn('./node_modules/nodeunit/bin/nodeunit', ['test']); | ||||
| 7 | var child = spawn('node', ['child.js']); | ||||
| 8 | child.stdout.on('data', function(buffer) { | ||||
| 9 | process.stdout.write(buffer); | ||||
| 10 | }); | ||||
| 11 | child.on('exit', this.async()); | ||||
| 12 | } | ||||
| 13 | |||||
| 14 | var context = { | ||||
| 15 | async: function() { return loop.bind(context); } | ||||
| 16 | }; | ||||
| 17 | loop.call(context); | ||||