mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
355 B
21 lines
355 B
9 years ago
|
'use strict';
|
||
|
|
||
|
require('../common');
|
||
|
const assert = require('assert');
|
||
|
|
||
|
var 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);
|
||
|
});
|