1// Flags: --abort-on-uncaught-exception
2'use strict';
3const common = require('../common');
4const assert = require('assert');
5const { Worker } = require('worker_threads');
6
7// Tests that --abort-on-uncaught-exception does not apply to
8// Workers.
9
10const w = new Worker('throw new Error()', { eval: true });
11w.on('error', common.mustCall());
12w.on('exit', common.mustCall((code) => assert.strictEqual(code, 1)));
13