Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename variable for clarity
  • Loading branch information
elyalvarado authored and Trott committed Jul 30, 2019
commit f07fd01df386028a421b00f116c6f508fb1112d1
12 changes: 6 additions & 6 deletions test/parallel/test-worker-terminate-null-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ const { Worker } = require('worker_threads');
// Test that calling worker.terminate() if kHandler is null should return an
// empty promise that resolves to undefined, even when a callback is passed

const w = new Worker(`
const worker = new Worker(`
const { parentPort } = require('worker_threads');
parentPort.postMessage({ hello: 'world' });
`, { eval: true });

process.once('beforeExit', common.mustCall(() => {
console.log('beforeExit');
w.ref();
worker.ref();
}));

w.on('exit', common.mustCall(() => {
worker.on('exit', common.mustCall(() => {
console.log('exit');
w.terminate().then((returned) => assert.strictEqual(returned, undefined));
w.terminate(() => null).then(
worker.terminate().then((returned) => assert.strictEqual(returned, undefined));
worker.terminate(() => null).then(
(returned) => assert.strictEqual(returned, undefined)
);
}));

w.unref();
worker.unref();