From 1fbad93b4d00b2c028725428af0b2190c9a6e5d5 Mon Sep 17 00:00:00 2001 From: Julian Grinblat Date: Mon, 11 Jul 2022 03:34:52 +0900 Subject: [PATCH] test(bindings/js): unfix segfault --- bindings/js/minify.go | 4 +++- bindings/js/test/worker.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bindings/js/minify.go b/bindings/js/minify.go index c7dee2bfe..5060ffcb1 100644 --- a/bindings/js/minify.go +++ b/bindings/js/minify.go @@ -166,7 +166,9 @@ func minifyFile(cmediatype, cinput, coutput *C.char) *C.char { //export minifyCleanup func minifyCleanup() { - os.Exit(0) + // This will fix the worker thread segfault test by explicitly ending the node + // process with a 0 signal + // os.Exit(0) } func main() {} diff --git a/bindings/js/test/worker.js b/bindings/js/test/worker.js index 06422ad51..56ba538d4 100644 --- a/bindings/js/test/worker.js +++ b/bindings/js/test/worker.js @@ -19,6 +19,7 @@ if (isMainThread) { throw "unexpected output using worker threads: '"+output+"' instead of '"+expected+"'"; } await worker.terminate(); + console.log("success!"); // this needs to be printed } else { const { config, string } = await import('@tdewolff/minify'); config({'html-keep-document-tags': true})