Skip to content

Commit 38ee544

Browse files
committed
iergh nothing works here
1 parent 484ae74 commit 38ee544

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎v4-cokapi/backends/javascript/jslogger.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,9 +981,11 @@ function listener(event, execState, eventData, data) {
981981

982982
// GET OUTTA HERE so that the user's script doesn't keep infinite looping
983983

984+
// ugh, on second thought, don't do this, since it locks up sometimes:
984985
// SUPER HACKY SHADY WAY TO FLUSH stdout before forcing an exit, OMG!!!
985986
// https://groups.google.com/forum/#!topic/nodejs-dev/Tj_HNQbvtZs
986-
while (!process.stdout.flush()); // flush before finalize; for some weird reason it works, ergh
987+
//while (!process.stdout.flush()); // flush before finalize; for some weird reason it works, ergh
988+
987989
finalize();
988990
process.exit(0 /* don't use an error exit code so that we don't trigger error handlers later on */);
989991
} else {
@@ -1162,7 +1164,9 @@ function finalize() {
11621164
log('Wrote trace to', argv.jsfile);
11631165
} else if (argv.jsondump) {
11641166
console.log(JSON.stringify(blob));
1165-
//console.log(JSON.stringify(blob, null, ' '));
1167+
// maybe this will work? do an exit after stdout flushes? still not
1168+
// fully working, though, ergh
1169+
//process.stdout.write(JSON.stringify(blob), process.exit.bind(null, 0));
11661170
} else if (argv.prettydump) {
11671171
console.log(util.inspect(blob, {depth: null}));
11681172
}

0 commit comments

Comments
 (0)