mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 19:16:32 +00:00

replace string concatenation with template literals. PR-URL: https://github.com/nodejs/node/pull/15820 Reviewed-By: Ryan Graham <r.m.graham@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
21 lines
766 B
JavaScript
21 lines
766 B
JavaScript
'use strict';
|
|
const common = require('../../common');
|
|
|
|
if (common.isWindows)
|
|
common.skip('dlopen global symbol loading is not supported on this os.');
|
|
|
|
const assert = require('assert');
|
|
const path = require('path');
|
|
const os = require('os');
|
|
|
|
const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
|
|
process.dlopen(module, bindingPath,
|
|
os.constants.dlopen.RTLD_NOW | os.constants.dlopen.RTLD_GLOBAL);
|
|
module.exports.load(`${path.dirname(bindingPath)}/ping.so`);
|
|
assert.strictEqual(module.exports.ping(), 'pong');
|
|
|
|
// Check that after the addon is loaded with
|
|
// process.dlopen() a require() call fails.
|
|
const re = /^Error: Module did not self-register\.$/;
|
|
assert.throws(() => require(`./build/${common.buildType}/binding`), re);
|