| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 82fc9a8 commit a6df727
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,10 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../common'); | |
| 3 | + | ||
| 3 | 4 | const assert = require('assert'); | |
| 4 | - const { Worker, isMainThread, parentPort } = require('worker_threads'); | ||
| 5 | - const { Server } = require('net'); | ||
| 6 | 5 | const fs = require('fs'); | |
| 6 | + const { Server } = require('net'); | ||
| 7 | + const { Worker, isMainThread, parentPort } = require('worker_threads'); | ||
| 7 | 8 | ||
| 8 | 9 | if (isMainThread) { | |
| 9 | 10 | const w = new Worker(__filename); | |
@@ -12,14 +13,13 @@ if (isMainThread) { | |||
| 12 | 13 | assert.strictEqual(typeof fd_, 'number'); | |
| 13 | 14 | fd = fd_; | |
| 14 | 15 | })); | |
| 15 | - w.on('exit', common.mustCall((code) => { | ||
| 16 | + w.on('exit', common.mustCall(() => { | ||
| 16 | 17 | if (fd === -1) { | |
| 17 | 18 | // This happens when server sockets don’t have file descriptors, | |
| 18 | 19 | // i.e. on Windows. | |
| 19 | 20 | return; | |
| 20 | 21 | } | |
| 21 | - common.expectsError(() => fs.fstatSync(fd), | ||
| 22 | - { code: 'EBADF' }); | ||
| 22 | + assert.throws(() => fs.fstatSync(fd), { code: 'EBADF' }); | ||
| 23 | 23 | })); | |
| 24 | 24 | } else { | |
| 25 | 25 | const server = new Server(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments