PR-URL: https://github.com/nodejs/node/pull/60142 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
17 lines
541 B
JavaScript
17 lines
541 B
JavaScript
// Flags: --permission --allow-fs-read=*
|
|
|
|
'use strict';
|
|
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
|
|
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
|
|
|
|
assert.throws(() => require(bindingPath), {
|
|
code: 'ERR_DLOPEN_DISABLED',
|
|
message: 'Cannot load native addon because loading addons is disabled.',
|
|
});
|
|
assert.throws(() => process.dlopen({ exports: {} }, bindingPath), {
|
|
code: 'ERR_DLOPEN_DISABLED',
|
|
message: 'Cannot load native addon because loading addons is disabled.',
|
|
});
|