2010-12-03 09:03:18 +08:00
|
|
|
common = require('../common');
|
|
|
|
assert = common.assert;
|
2010-09-08 13:34:21 +08:00
|
|
|
|
|
|
|
var order = [];
|
2010-12-03 09:03:18 +08:00
|
|
|
process.nextTick(function() {
|
2010-09-08 13:34:21 +08:00
|
|
|
setTimeout(function() {
|
|
|
|
order.push('setTimeout');
|
|
|
|
}, 0);
|
2010-09-10 01:30:37 +08:00
|
|
|
|
|
|
|
process.nextTick(function() {
|
|
|
|
order.push('nextTick');
|
|
|
|
});
|
2010-09-08 13:34:21 +08:00
|
|
|
})
|
|
|
|
|
2010-12-03 09:03:18 +08:00
|
|
|
process.addListener('exit', function() {
|
2010-09-08 13:34:21 +08:00
|
|
|
assert.deepEqual(order, ['nextTick', 'setTimeout']);
|
|
|
|
});
|