improve process.exit() workaround (#2741)

- use public API
- fix issue with Node.js 0.10 on WIndows
This commit is contained in:
Alex Lam S.L
2018-01-07 17:53:50 +08:00
committed by GitHub
parent 1ee8be8d91
commit 9809567dfc
4 changed files with 18 additions and 15 deletions

View File

@@ -6,11 +6,7 @@
// bin/uglifyjs s.js -c && bin/uglifyjs s.js -c passes=3 && bin/uglifyjs s.js -c passes=3 -m
// cat s.js | node && node s.js && bin/uglifyjs s.js -c | node && bin/uglifyjs s.js -c passes=3 | node && bin/uglifyjs s.js -c passes=3 -m | node
// workaround for tty output truncation upon process.exit()
[process.stdout, process.stderr].forEach(function(stream){
if (stream._handle && stream._handle.setBlocking)
stream._handle.setBlocking(true);
});
require("../tools/exit");
var UglifyJS = require("..");
var randomBytes = require("crypto").randomBytes;