mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 20:08:02 +00:00

Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
21 lines
355 B
JavaScript
21 lines
355 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
let once = 0;
|
|
|
|
process.on('beforeExit', () => {
|
|
if (once > 1)
|
|
throw new RangeError('beforeExit should only have been called once!');
|
|
|
|
setTimeout(() => {}, 1).unref();
|
|
once++;
|
|
});
|
|
|
|
process.on('exit', (code) => {
|
|
if (code !== 0) return;
|
|
|
|
assert.strictEqual(once, 1);
|
|
});
|