mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: https://github.com/nodejs/node/pull/58517 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
22 lines
494 B
JavaScript
22 lines
494 B
JavaScript
// Flags: --permission --allow-fs-read=*
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
const { isMainThread } = require('worker_threads');
|
|
|
|
if (!isMainThread) {
|
|
common.skip('This test only works on a main thread');
|
|
}
|
|
|
|
const assert = require('assert');
|
|
const dgram = require('dgram');
|
|
|
|
{
|
|
const socket = dgram.createSocket('udp4');
|
|
|
|
socket.on('error', common.mustCall((err) => {
|
|
assert.strictEqual(err.code, 'ERR_ACCESS_DENIED');
|
|
}));
|
|
|
|
socket.bind(0, common.mustNotCall());
|
|
}
|