summaryrefslogtreecommitdiffstats
path: root/node_modules/terser/tools/exit.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/terser/tools/exit.js')
-rw-r--r--node_modules/terser/tools/exit.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/node_modules/terser/tools/exit.js b/node_modules/terser/tools/exit.js
new file mode 100644
index 0000000..17048d8
--- /dev/null
+++ b/node_modules/terser/tools/exit.js
@@ -0,0 +1,15 @@
+// workaround for tty output truncation upon process.exit()
+var exit = process.exit;
+process.exit = function() {
+ var args = [].slice.call(arguments);
+ process.once("uncaughtException", function() {
+ (function callback() {
+ if (process.stdout.bufferSize || process.stderr.bufferSize) {
+ setImmediate(callback);
+ } else {
+ exit.apply(process, args);
+ }
+ })();
+ });
+ throw exit;
+};