From 8eed678a49fbb49dbad011a2b64661c39b7fa33f Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenko Date: Fri, 17 Mar 2017 18:12:46 +0300 Subject: [PATCH] [js] exit with code 1 on uncaught exception in nodejs environment (fixes #7) --- .gitignore | 3 ++- src/jstack/js/JStack.hx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6680a76..d860b7b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ cSpell.json .idea lab .vscode -jstack.zip \ No newline at end of file +jstack.zip +dump diff --git a/src/jstack/js/JStack.hx b/src/jstack/js/JStack.hx index 40dc1d2..19335fd 100644 --- a/src/jstack/js/JStack.hx +++ b/src/jstack/js/JStack.hx @@ -150,6 +150,9 @@ class JStack { var error = uncaughtExceptionHandler(e); if(error != null && error.length > 0) { untyped __js__('console.log({0})', error); + if (isNode()) { + untyped __js__('process.exit(1)'); + } } }