fix: export libuv symbols (#24659)
* fix: export libuv symbols * add test for linux and windows * mac linker flags * assuming same foo.so path for macos * use --whole-archive flag for mac as well * use force_load for mac * refactor: use napi c api directly Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
parent
7ded768743
commit
14aba3f0de
10 changed files with 115 additions and 1 deletions
|
|
@ -44,6 +44,27 @@ describe('modules support', () => {
|
|||
});
|
||||
});
|
||||
|
||||
const enablePlatforms: NodeJS.Platform[] = [
|
||||
'linux',
|
||||
'darwin',
|
||||
'win32'
|
||||
];
|
||||
ifdescribe(nativeModulesEnabled && enablePlatforms.includes(process.platform))('module that use uv_dlopen', () => {
|
||||
it('can be required in renderer', async () => {
|
||||
const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true } });
|
||||
w.loadURL('about:blank');
|
||||
await expect(w.webContents.executeJavaScript('{ require(\'uv-dlopen\'); null }')).to.be.fulfilled();
|
||||
});
|
||||
|
||||
ifit(features.isRunAsNodeEnabled())('can be required in node binary', async function () {
|
||||
const child = childProcess.fork(path.join(fixtures, 'module', 'uv-dlopen.js'));
|
||||
await new Promise(resolve => child.once('exit', (exitCode) => {
|
||||
expect(exitCode).to.equal(0);
|
||||
resolve();
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
describe('q', () => {
|
||||
describe('Q.when', () => {
|
||||
it('emits the fullfil callback', (done) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue