summaryrefslogtreecommitdiff
path: root/test/parallel/test-worker-esm-exit.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-02-15 14:33:23 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-02-20 05:33:04 +0100
commit7b198935d63aec4acace1500d81ac2662c732d18 (patch)
tree48e461ef7a9b10381f89a491553903482197fb68 /test/parallel/test-worker-esm-exit.js
parentd2c29bda50c4e5579537ab8cb9ac5d1f567da4a8 (diff)
downloadnode-new-7b198935d63aec4acace1500d81ac2662c732d18.tar.gz
src: only call .ReThrow() if not terminating
Otherwise, it looks like a `null` exception is being thrown. PR-URL: https://github.com/nodejs/node/pull/26130 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'test/parallel/test-worker-esm-exit.js')
-rw-r--r--test/parallel/test-worker-esm-exit.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-worker-esm-exit.js b/test/parallel/test-worker-esm-exit.js
new file mode 100644
index 0000000000..c0b9d87489
--- /dev/null
+++ b/test/parallel/test-worker-esm-exit.js
@@ -0,0 +1,10 @@
+'use strict';
+const common = require('../common');
+const fixtures = require('../common/fixtures');
+const assert = require('assert');
+const { Worker } = require('worker_threads');
+
+const w = new Worker(fixtures.path('es-modules/import-process-exit.mjs'),
+ { execArgv: ['--experimental-modules'] });
+w.on('error', common.mustNotCall());
+w.on('exit', (code) => assert.strictEqual(code, 42));