fix: crash in utilityProcess when generating code from strings (#38014)
This commit is contained in:
parent
f12e12b341
commit
0240f6664e
14 changed files with 72 additions and 48 deletions
|
@ -360,5 +360,19 @@ describe('utilityProcess module', () => {
|
|||
await once(child, 'exit');
|
||||
expect(log).to.equal('hello\n');
|
||||
});
|
||||
|
||||
it('does not crash when running eval', async () => {
|
||||
const child = utilityProcess.fork('./eval.js', [], {
|
||||
cwd: fixturesPath,
|
||||
stdio: 'ignore'
|
||||
});
|
||||
await once(child, 'spawn');
|
||||
const [data] = await once(child, 'message');
|
||||
expect(data).to.equal(42);
|
||||
// Cleanup.
|
||||
const exit = once(child, 'exit');
|
||||
expect(child.kill()).to.be.true();
|
||||
await exit;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue