1'use strict'; 2const common = require('../common'); 3const { Worker } = require('worker_threads'); 4 5// Like test-async-hooks-worker-promise.js but with an additional statement 6// after the `process.exit()` call, that shouldn’t really make a difference 7// but apparently does. 8 9const w = new Worker(` 10const { createHook } = require('async_hooks'); 11 12setImmediate(async () => { 13 createHook({ init() {} }).enable(); 14 await 0; 15 process.exit(); 16 process._rawDebug('THIS SHOULD NEVER BE REACHED'); 17}); 18`, { eval: true }); 19 20w.on('exit', common.mustCall()); 21