Skip to content

Commit

Permalink
improve node stdout workaround to work in closure
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Jul 28, 2014
1 parent 65eb97c commit 6db3be4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/postamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function exit(status) {
// Instead of process.exit() directly, wait for stdout flush event.
// See https://github.com/joyent/node/issues/1669 and https://github.com/kripken/emscripten/issues/2582
// Workaround is based on https://github.com/RReverser/acorn/commit/50ab143cecc9ed71a2d66f78b4aec3bb2e9844f6
process.stdout.once('drain', function () {
process['stdout']['once']('drain', function () {
process['exit'](status);
});
console.log(' '); // Make sure to print something to force the drain event to occur, in case the stdout buffer was empty.
Expand Down

0 comments on commit 6db3be4

Please sign in to comment.